Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
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 images/.DS_Store
Binary file not shown.
Binary file added images/facebook.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 images/home_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 images/home_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 images/home_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 images/home_bottom.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 images/home_top.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 images/instagram.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 images/panda_logo.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 images/twitter.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 images/youtube.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
126 changes: 126 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8">
<title>판다마켓</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<div class="header-contents">
<div class="logo">
<img src="images/panda_logo.png">
<a href="/">판다마켓</a>
</div>
<a class="login" href="/login">로그인</a>
</div>
</header>
<main>
<div class="blue">
Copy link
Collaborator

Choose a reason for hiding this comment

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

left, blue와 같이 위치나 색상등의 정보를 포함한 css 네이밍은 다소 적절하지않아요.
이유는 디자인이 변경된다면 실제 스타일과 클래스명이 불일치할 수 있고, 이는 곧 재사용성의 저해로 이어지기때문입니다.
따라서, 다음부터는 해당 엘리먼트의 목적과 역할을 보다 직관적으로 이해할 수 있게끔 염두에 두고 작업해보시는걸 추천드립니다 :)

<div class="panda">
<div class="description">
<h1>
일상의 모든 물건을<br>
거래해 보세요
</h1>
<a class="looking" href="/items">구경하러 가기</a>
</div>
<img src="images/home_top.png">
</div>
</div>

<section>
<div class="contents">
Copy link
Collaborator

Choose a reason for hiding this comment

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

전체적으로 클래스이름 잘 써주셨는데, 하나만 더 신경써주면 좋을것같아요 :)
contents보다는 feature-contents와 같은 이름으로 지어주면 의미가 명확해지고, 유지보수 관점에서 동일한 클래스이름 중복으로 인한 이슈를 방지해볼수있겠죠?

<img src="images/home_01.png">
<div class="content">
<p class="title">Hot item</p>
<div class="description">
<h1>
인기 상품을<br>
확인해 보세요
</h1>
<p>
가장 HOT한 중고거래 물품을<br>
판다 마켓에서 확인해 보세요
</p>
</div>
</div>
</div>
</section>

<section>
<div class="contents">
<div class="content left">
<p class="title">Search</p>
<div class="description">
<h1>
구매를 원하는<br>
상품을 검색하세요
</h1>
<p>
구매하고 싶은 물품은 검색해서<br>
쉽게 찾아보세요
</p>
</div>
</div>
<img src="images/home_02.png">
Copy link
Collaborator

Choose a reason for hiding this comment

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

귀찮더라도 img에 alt 사용은 꼭 해주시는게 좋아요!
웹 접근성뿐만 아니라, 이미지 로딩 실패 시 대체 텍스트를 표시하거나 검색엔진최적화에도 도움을 줄 수 있기 때문에 꼭 사용해주시는게 좋습니다.

레퍼런스로 애플 공식 웹사이트에 가서 alt텍스트를 어떻게 사용했는지 참고해보시면:

<img src="/kr/macbook-air/images/overview/design/design_hero_static__e56c1v71mr6u_large.jpg" onload="__lp(event)" alt="열려있는 MacBook Air 13 및 15의 모습. 한 대에는 디자인 작업을 진행 중인 화면이, 다른 한 대에는 이메일과 스프레드시트를 넘나들며 멀티태스킹을 하는 화면이 표시되어 있습니다">

이런식으로 alt 속성에 이미지 설명을 위해 구체적이고 명확한 설명을 제공하는 모습을 확인해보실 수 있습니다 :)

</div>
</section>

<section>
<div class="contents">
<img src="images/home_03.png">
<div class="content">
<p class="title">Register</p>
<div class="description">
<h1>
판매를 원하는<br>
상품을 등록하세요
</h1>
<p>
어떤 물건이든 판매하고 싶은 상품을<br>
쉽게 등록하세요
</p>
</div>
</div>
</div>
</section>

<div class="blue">
<div class="panda bottom">
<div class="description">
<h1>
믿을 수 있는<br>
판다마켓 중고거래
</h1>
</div>
<img src="images/home_bottom.png">
</div>
</div>

</main>
<footer>
<div class="footer-info">
<p>@codeit-2024</p>
<div class="footer-page">
<a href="/privacy">Privacy</a>
<a href="/faq">FAQ</a>
</div>
<div class="social">
<a href="https://facebook.com" target="_blank">
<img src="images/facebook.png" alt="facebook" width="20">
</a>
<a href="https://twitter.com" target="_blank">
<img src="images/twitter.png" alt="twitter" width="20">
</a>
<a href="https://youtube.com" target="_blank">
<img src="images/youtube.png" alt="youtube" width="20">
</a>
<a href="https://instagram.com" target="_blank">
<img src="images/instagram.png" alt="instargram" width="20">
</a>
</div>
</div>
</footer>
</body>
</html>
212 changes: 212 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
* {
box-sizing: border-box;
}

html {
font-family: Pretendard, sans-serif;
}

body {
margin: 0;
padding: 0;

}
Comment on lines +1 to +13
Copy link
Collaborator

Choose a reason for hiding this comment

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

요런 코드는 css reset/ normalize 용도의 파일로 따로 분리해서 import해서 사용하는건 어떨까요?

  • reset.css: 스타일 초기화
  • common.css: 전역 스타일 처리

이렇게 용도에 따라 css 파일을 나눠 사용해보는 경험을 늘려봅시다! :)


header {
background-color: #ffffff;
border: 1px solid #DFDFDF;
width: 100%;
min-width: 1920px;
Copy link
Collaborator

Choose a reason for hiding this comment

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

음 min-width: 1920px이 여기저기서 많이 쓰였네요? 이러면 가로 너비가 줄어들때 잘림 현상이 발생될텐데 어떤 의도로 쓰인걸까요? 그리고 동일한 스타일 블락이 꽤 중복되는것 같아요. (header, main section, .blue, footer) 이것도 하나의 클래스로 통합해주면 중복이 좀 사라지겠죠?

예시)

.container {
  width: 100%;
  min-width: 1920px;
  display: flex;
  justify-content: center;
}

.center-content {
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

height: 70px;
display: flex;
justify-content: center;
align-items: center;
}

.header-contents {
width: 100%;
max-width: 1120px;
display: flex;
justify-content: space-between;
align-items: center;
}

.logo {
display: flex;
justify-content: center;
align-items: center;
gap: 10px;
}

.logo a {
color: #3692FF;
Copy link
Collaborator

Choose a reason for hiding this comment

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

자주 사용되는 값을 css 변수로 관리해볼까요? 코드 중복을 줄이면서 재사용성을 높일수있습니다 :)

:root {
  --primary-color: #3692FF;
  --background-light: #CFE5FF;
  --text-dark: #374151;
  --white: #ffffff;
  --max-width: 1120px;
}

font-family: 'ROKAF Sans';
font-size: 25.63px;
font-weight: 700;
line-height: 100%;
text-decoration: none;
cursor: pointer;
}

.login {
background-color: #3692FF;
color: #ffffff;
width: 128px;
height: 48px;
padding: 12px 23px;
gap: 10px;
border-radius: 8px;
font-size: 16px;
font-weight: 600;
line-height: 26px;
display: flex;
justify-content: center;
text-decoration: none;
cursor: pointer;
}

main section {
background-color: #ffffff;
width: 100%;
min-width: 1920px;
height: auto;
padding: 80px 10%;
gap: 10px;
display: flex;
justify-content: center;
align-items: center;
}

.blue {
background-color: #CFE5FF;
width: 100%;
min-width: 1920px;
Copy link
Collaborator

Choose a reason for hiding this comment

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

최소 너비를 1920px로 써주시면 화면 가로 사이즈가 1920px 이하일때 잘려서 보이는 현상이 발생할거예요.
반응형을 고려할때도 좋지않은 선택입니다 :) 해당 클래스가 적용된 클래스에서 어떤 경우에든 부모 컨테이너 너비를 넘어 가로 너비를 꽉 채우는것을 생각하셨다면 이런건 어떨까요?

.full-width {
  margin-left: -50vw;
  left: 50%;
  width: 100vw;
  position: relative;
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

이렇게 코드를 작성하게 된다면, full-width은 html에서 태그를 한번 더 만들어줘야하는 것일까요?

Copy link
Collaborator

Choose a reason for hiding this comment

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

해당 스타일 규칙을 적용할 엘리먼트에 클래스이름으로 적용해주시면됩니다 :) @canofmato

height: 540px;
top: 70px;
display: flex;
justify-content: center;
align-items: flex-end;
}

.panda {
display: flex;
justify-content: center;
gap: 7px;
}

.panda.bottom {
align-items: center;
gap: 69px;
}


.panda.description {
padding-bottom: 60px;
gap: 32px;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

NIT: 지금도 깔끔하게 구조화가 되어있어 보기 좋지만, 좀더 의미가 명확하고 직관적인 클래스이름을 부여해주는건 어떨까요?

.description {
  color: #374151;
  gap: 24px;
}

.description--panda {  /* BEM 적용 */
  padding-bottom: 60px;
  gap: 32px;
}

이런식으로 BEM을 적용하다보면

.description h1 {
  font-size: 40px;
  font-weight: 700;
  line-height: 140%;
}

이런 코드도 아래처럼 좀더 의미있고 명확한 클래스명을 가지게끔 보여줄수있어요.

.description__title { 
  font-size: 40px;
  font-weight: 700;
  line-height: 140%;
}


.looking {
background-color: #3692FF;
color: #F9FAFB;
height: 56px;
border-radius: 40px;
padding: 14px 124px;
gap: 10px;
font-size: 20px;
font-weight: 600;
line-height: 32px;
text-align: center;
text-decoration: none;
cursor: pointer;
}


section .contents {
background-color: #FCFCFC;
position: relative;
width: 988px;
height: auto;
max-height: 444px;
border-radius: 12px;
gap: 64px;
display: flex;
justify-content: center;
align-items: center;
}

.contents > img {
height: 100%;
}

.contents .content {
position: relative;
padding-right: 24px;
gap: 12px;
}

.content .title {
color: #3692FF;
font-size: 18px;
font-weight: 700;
line-height: 26px;
}

.content .description {
color: #374151;
gap: 24px;
}

.content.left {
text-align: right;
padding-left: 24px;
padding-right: 0;
}

.description h1 {
font-size: 40px;
font-weight: 700;
line-height: 140%;
}

.description p {
font-size: 24px;
font-weight: 500;
line-height: 32px;
}

footer {
background-color: #111827;
width: 100%;
min-width: 1920px;
height: 160px;
padding: 32px 400px;
gap: 10px;
display: flex;
justify-content: center;
}

.footer-info {
color: #ffffff;
width: 100%;
max-width: 1120px;
display: flex;
justify-content: space-between;
font-size: 16px;
font-weight: 400;
line-height: 100%;
}

.footer-page {
display: flex;
gap: 30px;
}

.footer-info a {
color: #ffffff;
text-decoration: none;
}

.social {
display: flex;
gap: 12px;
}
Loading