강의

멘토링

커뮤니티

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

최LEO님의 프로필 이미지
최LEO

작성한 질문수

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

[그랩마켓] 웹 화면 구현하기 - 3

span 줄바꿈 스타일이 적용되지 않습니다

작성

·

335

1

<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>농구공 1호</span>
<span>50000원</span>
</div>
</div>
</div>
</div>
<div id="footer"></div>
</body>
</html>
- 스타일부분
* {
margin: 0;
padding: 0;
}

#header {
height: 64px;
display: flex;
justify-content: center;
border-bottom: 1px solid gray;
}

#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;
margin-left: 5px;
}

#banner > img {
width: 100%;
}

#body > h1 {
margin-top: 16px;
}

#product-list {
display: flex;
flex-wrap: wrap;
margin-top: 12px;
}

.product-card {
width: 180px;
height: 300px;
margin-left: 12px;
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 : 600;
}

.product-seller {
display: flex;
align-items: center;

}

.product-avatar {
width: 24px;
}
// 위 소스로 진행했을때 농구공 1호와 50000원 사이에 줄바꿈 스타일이 적용되지 않습니다ㅠㅠ
확인 부탁드립니다.

답변 1

0

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

Style에서 .product-contents 를 보면

display: : flex;

display : flex에서 :이 하나 더 있는 걸 지워주시면 될 것 같아요.

최LEO님의 프로필 이미지
최LEO

작성한 질문수

질문하기