강의

멘토링

커뮤니티

인프런 커뮤니티 질문&답변

JJJIN J님의 프로필 이미지
JJJIN J

작성한 질문수

비전공자를 위한 진짜 입문 올인원 개발 부트캠프

안되는 부분 코드 검토 부탁드립니다.

작성

·

133

1

- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요!
- 먼저 유사한 질문이 있었는지 검색해보세요.
- 서로 예의를 지키며 존중하는 문화를 만들어가요.
- 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
1.아래 빨간footer 화면이 영상과 다르게 제품과 붙어 있습니다.
2. 아바타 그랩 중간 정렬이 되지 않습니다.
html 코드
<html>
<head>
<title>그랩마켓</title>
<link href="index.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="header">
<div id="header-area">
<img src="images/icons/logo.png" />
</div>
</div>
<div id="body">
<div id="banner">
<img src="images/banners/banner1.png" />
</div>
<h1>판매되는 상품들</h1>
<div id="product-list">
<div class="product-card">
<div>
<img class="product-img" src="images/products/basketball1.jpeg" />
</div>
<div class="product-contents">
<span class="product-name">농구공 1호</span>
<span class="product-price">50000원</span>
<div class="product-seller">
<div>
<img class="product-avatar" src="images/icons/avatar.png"/>
<span>그랩</span>
</div>
</div>
</div>
</div>
</div>
<div id="footer"></div>
</body>
</html>
css코드 * {
margin: 0;
padding: 0;
}

#header {
height: 64px;
border-bottom: 1px solid gray;

display: flex;

justify-content: center;
}
#body {
height: 100%;
width: 1024px;

margin: 0 auto;
padding-bottom: 24px;
}

#footer {
height: 200px;
background-color: red;
}

#banner {
height: 300px;
background-color: yellow;
}
#header-area {
width: 1024px;
height: 100%;

display: flex;
align-items: center;
}

#header-area > img {
width: 128px;
height: 36px;
}

#banner > img {
width: 100%;
height: 300px;
}
#body > h1 {
margin-top: 16px;
}

#product-list {
display: flex;
flex-wrap: wrap;
}

.product-card {
width: 180px;
height: 300px;

margin-right: 12px;
margin-bottom: 12px;
border: 1px solid rgb(230, 230, 230);
border-radius: 12px;
}

.product-img {
width: 100%;
height: 210px;
}

.product-contents {
display: flex;
flex-direction: column;
padding: 8px;
}

.product-name {
font-size: 14px;
}

.product-price {
font-size: 16px;
font-weight: 600px;
}

.product-seller {
display: flex;
align-items: center;
}
.product-avatar {
width: 24px;
}

답변 1

0

그랩님의 프로필 이미지
그랩
지식공유자

현재 크롬 개발자도구에서 보면 id#footer 태그가 id#body안에 들어가있습니다. 
div에 대한 closing tag(</div>)가 하나 빠져있어서 그렇네요.

아래 코드를 보시면 product-seller 코드 바로 아래에 <div> 태그가  들어가서 구조가 깨진 것 같아 보여요. 삭제해주시면 될 것 같습니다

<div class="product-seller">

<div>

<img class="product-avatar" src="images/icons/avatar.png"/>

<span>그랩</span>

</div>

JJJIN J님의 프로필 이미지
JJJIN J

작성한 질문수

질문하기