Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Binary file added Session01/.DS_Store
Binary file not shown.
Binary file added Session01/htmlcss1/.DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions Session01/htmlcss1/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
97 changes: 97 additions & 0 deletions Session01/htmlcss1/album.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css"/>
<link rel="stylesheet" href="sec01.css"/>
<link rel="stylesheet" href="sec02.css"/>
<link rel="stylesheet" href="sec03.css"/>

<title>김밍밍</title>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

별명이 밍밍인가요..? 너무 귀엽다,,💛

</head>
<body>
<h2>NewYork</h2>
<div class="container">
<section class="prSction">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

img들을 모두 div로 감싼 이유가 무엇인가요? class 지정을 위해서라면 img에 클래스를 직접 추가해도 될 것 같아서요!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그리고 class를 추가하지 않고 .container > img로 더 간단하게 지정할 수 있습니다!
선택자를 적절히 사용하면 좀 더 편하게 스타일 지정이 가능합니다:)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 지민언니와 같이 img 태그 같은경우 div 로 감싸지 않고 바로 단독으로 썼으면 좋겠어요!
불필요한 div 태그를 남발하는 경우, 1. 불필요한 DOM node 생성으로 불필요한 메모리를 잡아먹는 단점이 있으니 div 태그의 필요성에 대해 고민하며 코드를 작성하면 좋을 것 같습니다! 👍

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

또한 저도 고칠 점인데 생각과제로 알아본 웹 접근성을 위해서 ... 시맨틱 태그 적극적으로 활용하기!
<article>는 독립적으로 배포 및 재사용할 수 있는 독립형 콘텐츠에 사용되니 이 태그도 사용하면 좋을 것 같습니다.

<!-- 이미지 미리보기 항목 -->
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그리고 html 언어 설정이 현재 한국어로 되어 있기 때문에 스크린 리더기가 읽기 쉽도록 alt도 설정 언어에 맞게 한국어로 작성하는 것을 추천드립니다!

<div class="prItem">
<img src="wk1/01.png" alt="Photo">
</div>
<div class="prItem">
<img src="wk1/02.png" alt="Photo">
</div>
<div class="prItem">
<img src="wk2/01.png" alt="Photo">
</div>
<div class="prItem">
<img src="wk2/02.png" alt="Photo">
</div>
<div class="prItem">
<img src="wk3/01.png" alt="Photo">
</div>
<div class="prItem">
<img src="wk3/02.png" alt="Photo">
</div>
<div class="prItem">
<img src="wk1/04.png" alt="Photo">
</div>
<!-- 추가 이미지 항목들 추가 가능 -->
</section>
</div>
<nav>
<h3>category</h3>
<ul>
<li><a href="#sec01">[1] 뉴욕은 낭만이 넘치는 도시에요</a></li>
<li><a href="#sec02">[2] 가을맞이에 한창인 뉴욕</a></li>
<li><a href="#sec03">[3] 애증의 뉴욕 이놈자식 그래도 사랑해</a></li>
</ul>
</nav>
<section id="sec01" class="sec01img">
<h4>뉴욕은 낭만이 넘치는 도시에요</h4>
<div class="flexbox01">
<div class="sec01item"><img src="wk1/02.png"></div>
<div class="sec01item"><img src="wk1/08.png"></div>
<div class="sec01item"><img src="wk1/03.png"></div>
<div class="sec01item"><img src="wk1/04.png"></div>
<div class="sec01item"><img src="wk1/05.png"></div>
<div class="sec01item"><img src="wk1/11.png"></div>
<div class="sec01item"><img src="wk1/09.png"></div>
<div class="sec01item"><img src="wk1/10.png"></div>
<div class="sec01item"><img src="wk1/01.png"></div>
</div>
</section>
<section id="sec02" class="sec02img">
<h4>가을맞이에 한창인 뉴욕</h4>
<div class="flexbox02">
<div class="big"><img src="wk2/04.png"></div>
<div class="small">
<img src="wk2/06.png">
<img src="wk2/01.png">
<img src="wk2/09.png">
<img src="wk2/07.png">
</div>
</div>
</section>
<section id="sec03" class="sec03img">
<h4>애증의 뉴욕 이놈자식 그래도 사랑해</h4>
<div class="grid-container">
<div class="grid-item"><img src="wk3/10.png"></div>
<div class="grid-item"><img src="wk3/12.png"></div>
<div class="grid-item"><img src="wk3/03.png"></div>
<div class="grid-item"><img src="wk3/11.png"></div>
<div class="grid-item"><img src="wk3/01.png"></div>
<!-- 원하는 만큼 이미지 추가 -->
</div>
</section>
<footer>
<div class="footerContent">
<p>&copy; 2023 Sopt</p>
<button id="topButton"><div style="cursor:pointer;" onclick="window.scrollTo(0,0);">Top</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

인라인 스타일을 사용했는데, 일반적으로 문제를 더 효과적으로 분리하고 유지 관리하기 위해 외부 CSS 파일에서 이러한 스타일을 정의하는 것이 좋습니다!
저는 <a href > 로 script 없이 이동시켜봤어요!

</button>
</div>
</footer>
</div>
</body>
</html>
16 changes: 16 additions & 0 deletions Session01/htmlcss1/button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
document.addEventListener("DOMContentLoaded", function () {
var topButton = document.getElementById("topButton");

window.addEventListener("scroll", function () {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
topButton.style.display = "block";
} else {
topButton.style.display = "none";
}
});

topButton.addEventListener("click", function () {
document.body.scrollTop = 0; // Safari
document.documentElement.scrollTop = 0; // Chrome, Firefox, IE, Opera
});
});
27 changes: 27 additions & 0 deletions Session01/htmlcss1/sec01.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.sec01img{
justify-content: center; /* 이미지를 가운데 정렬 */
align-items: center;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 속성같은 경우에 display: flex; 가 있어야 적용되는 속성입니다!

}
.flexbox01{
flex-wrap:wrap;
white-space: nowrap;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

white-space 속성은 줄바꿈 및 공백을 설정합니다. 그래서 flexbox01 에는 불필요해 보이는 요소 같아요!

/* 아이템의 너비 설정 (여기서는 3개로 나눔) */
display: flex;
}
.sec01item {
width:200px;
height: 200px;
flex-grow: 1;
border: 1px solid #ddd;
margin-right: 10px;
margin-bottom: 10px;
/* 이미지 간 간격 설정 */
}

.sec01item img{
width:100%;
height: 100%;
}



37 changes: 37 additions & 0 deletions Session01/htmlcss1/sec02.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.sec02img{
width:100%;
}
.flexbox02{
display: flex; flex-direction: row;
white-space: nowrap;
width:100%;
height:300px;
justify-content: center;
gap:10px;
}
.big{
width:50%;
height:100%;
border: 1px ;
}
.big img{
width:100%;
height:100%;
}
.small{
flex-wrap:wrap;
width:50%;
display:flex;
height:100%;
gap:10px;
}
.small img{
width: calc(50% - 6px); /* 간격을 뺀 크기로 설정합니다 */
height: calc(50% - 6px); /* 간격을 뺀 크기로 설정합니다 */

}





39 changes: 39 additions & 0 deletions Session01/htmlcss1/sec03.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* 그리드 컨테이너 스타일 */
.grid-container {
display: grid;
grid-template-rows: repeat(4, 110px);
grid-template-columns: repeat(8, 1fr);
grid-auto-rows: 100px;
gap: 10px; /* 그리드 아이템 사이의 간격 설정 */
}

/* 그리드 아이템 스타일 */
.grid-item {
border: 1px solid #ccc; /* 그리드 아이템 테두리 스타일 설정 */
text-align: center;
}
.grid-item:first-child {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아! 이렇게 할 수 있구나 ㅜㅜ 대박 이런 방법도 알아갑니당!!

grid-row: 1/ 2;
grid-column: 1/5;
}
.grid-item:nth-child(2) {
grid-row: 2 / 3;
grid-column: 1/5;
}
.grid-item:nth-child(3) {
grid-row: 1 / 3;
grid-column: 5/9;
}
.grid-item:nth-child(4) {
grid-row: 3 / 5;
grid-column: 1/7;
}
.grid-item:nth-child(5) {
grid-row: 3 / 5;
grid-column: 7/9;
}
/* 이미지 크기 조절 */
.grid-item img {
width: 100%; /* 그리드 아이템 내의 이미지 최대 너비 설정 */
height: 100%; /* 비율에 맞게 이미지 높이 조절 */
}
88 changes: 88 additions & 0 deletions Session01/htmlcss1/style.css
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list-style-type: none; 같이 자주 쓰이는 css 속성들은 reset.css 파일을 만들어서 한 번에 적용해주면 편리합니다!
reset.css 작성 방법은 다양하고 정답이 없기 때문에 아래 글 참고해서 자신에게 맞는 파일을 한 번 만들어보는 걸 추천드려요:)
CSS Reset 파일 작성법

Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
h2 {
background-color: palegoldenrod;
color: black;
text-align: center;
line-height: 2;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혹시 모두 line-height: 2;로 지정해준 이유가 있을까요?
그리고 line-height 속성에 대해 찾아보다가 생각과제였던 웹 접근성과 관련된 내용이 있어 공식문서 링크도 첨부합니다!
line-height
난독증 환자나 시력이 좋지 않은 사람들을 위해 line-height를 최소 1.5로 정하는 걸 추천해준다고 하는데 그런 면에서 좋은 코드라고 생각되어요:)

}
h3{
color:black;
line-height: 2;
margin-bottom: 0%;
}
h4{
position: sticky;
background-color: rgb(245, 208, 214);
line-height: 2;
}
/*position: sticky;*/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 주석을 실수로 올리는 경우가 많은데요..!ㅎㅎ 필요하지 않은 주석은 제거하고 PR 올려주는 게 좋습니다!

body {
padding: 0; /*안쪽 여백 0*/
font-family: meiryo, sans-serif;
}

.prSction{
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CSS 네이밍 규칙에 맞게 줄임말보다는 직관적이고 이해하기 쉬운 클래스명을 사용하면 나중에 더 복잡해졌을 때 작업하기 수월해요!
저도 수정할 예정입니다..!ㅎㅎ
CSS 네이밍 규칙

overflow-x: scroll;
display: flex;
width: 100%; height: 100%;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 정렬 하면 좀 더 깔끔할 것 같아요!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 정렬할 때 참고하면 좋은 자료 첨부합니다! 다만 너무 엄격하게 전부 지키려고 하면 오히려 효율이 떨어질 수 있어서 본인에게 맞는 방식으로 큼직하게 나눠주면 나중에 리팩토링할 때나 코드리뷰할 때도 편리하답니다😊
CSS 작성 순서

white-space: nowrap;
}

.prItem {
width: 100%;
height: 100%;
/* 각 이미지의 너비 설정 */
margin-right: 10px;
/* 이미지 간 간격 설정 */
}


/* 추가적인 스타일링을 위한 예시 */
.prItem img {
width: 200px;
height: 200px;
border: 1px solid #ddd;
/*border-radius: 5px;*/
}

ul {
list-style-type: none; /* 목록 스타일 제거 */
padding: 0; /* 목록 내부 패딩 제거 */
margin: 0; /* 목록 주변 여백 제거 */
/*position: sticky;*/
}
ul li{
margin-bottom: 10px;
}

ul li a {
text-decoration: none;
color: #333;
transition: color 0.3s, text-decoration 0.3s;
}

ul li a:hover {
color: rgb(106, 166, 223); /* hover 시 텍스트 색상 변경 */
text-decoration: underline; /* hover 시 밑줄 표시 */
cursor: pointer;
}

.footerContent p{
text-align: center;
}

/* Top 버튼 스타일 */
#topButton {
position:fixed;
bottom: 10px;
right: 10px;
background-color: #c8def5;
color: #000000;
border: none;
padding: 10px 20px;
border-radius: 5px;
font-size: 16px;
}

#topButton:hover {
background-color: #efc9e6;
}
17 changes: 17 additions & 0 deletions Session01/htmlcss1/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="b"><img src="wk3/05.png"></div>
<div class="c"><img src="wk3/07.png"></div>
<div class="d"><img src="wk3/04.png"></div>
<div class="e"><img src="wk3/01.png"></div>

<section id="sec03" class="sec03img">
<h4>애증의 뉴욕 이놈자식 그래도 사랑해</h4>
<div class="green">
<img src="wk3/05.png">
<img src="wk3/07.png">
<img src="wk3/04.png">
</div>
<div class="apple">
<div class="d">d</div>
<div class="e">e</div>
</div>
</section>
Binary file added Session01/htmlcss1/wk1/.DS_Store
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

레포에 안 올라가는 이런 파일들은 .gitignore 파일을 추가해서 깔끔하게 관리하는 걸 추천드려요😊
.gitignore 작성방법 및 생성 사이트

Binary file not shown.
Binary file added Session01/htmlcss1/wk1/01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk1/02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk1/03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk1/04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk1/05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk1/06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk1/07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk1/08.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk1/09.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk1/10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk1/11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk2/.DS_Store
Binary file not shown.
Binary file added Session01/htmlcss1/wk2/01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk2/02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk2/03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk2/04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk2/05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk2/06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk2/07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk2/08.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk2/09.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk3/.DS_Store
Binary file not shown.
Binary file added Session01/htmlcss1/wk3/01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk3/02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk3/03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk3/04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk3/05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Session01/htmlcss1/wk3/06.png
Binary file added Session01/htmlcss1/wk3/07.png
Binary file added Session01/htmlcss1/wk3/08.png
Binary file added Session01/htmlcss1/wk3/09.JPG
Binary file added Session01/htmlcss1/wk3/10.png
Binary file added Session01/htmlcss1/wk3/11.png
Binary file added Session01/htmlcss1/wk3/12.png
Binary file added Session01/htmlcss1/wk3/IMG_1962.HEIC
Binary file not shown.
Loading