오늘은 네이버 쇼핑부분을 작업해보았다.
<ul>
<li><a href="#">메일</a></li>
<li><a href="#">카페</a></li>
<li><a href="#">블로그</a></li>
<li><a href="#">지식인</a></li>
<li><a href="shop.html">쇼핑</a></li>
<li><a href="#">웹툰</a></li>
</ul>
shop.html 파일을 따로 만들어 index.html 에 있는 쇼핑부분에 추가해주어
클릭하면 쇼핑페이지로 넘어가도록 연결해준다.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>네이버</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body id="shop-body">
<header id="shop-header">
<div id="shop-header-top"></div>
<div id="shop-header-middle"></div>
<nav>
<div class="shop-container">
<ul>
<li><a href="#">홈</a></li>
<li><a href="#">백화점</a></li>
<li><a href="#">아울렛</a></li>
<li><a href="#">스타일</a></li>
</ul>
</div>
</nav>
</header>
#shop-body {
background-color: #e9ecef
}
.shop-container {
width: 1300px;
margin: 0 auto;
}
.shop-border {
border: solid 1px #ced2d7;
}
.w-100 {
width: 100%;
}
.h-100 {
height: 100%;
}
#shop-header #shop-header-top {
width: 100%;
height: 36px;
background-color: #03c75a;
border-bottom: solid 1px #e8e8e8;
}
#shop-header #shop-header-middle {
width: 100%;
height: 66px;
background-color: #03c75a;
}
#shop-header nav {
width: 100%;
/*background-color: #ffffff;*/
border-top: solid 1px #e8e8e8;
border-bottom: solid 1px #e8e8e8;
}
#shop-header nav ul {
display: flex;
flex-wrap: wrap;
align-items: center;
padding: 13px 0 8px 0;
}
#shop-header nav ul li {
margin-right: 16px;
}
<main role="main" id="shop-main">
<div class="shop-container">
<div class="list-wrap">
<div class="list-item">
<div class="category-wrap w-100 h-100 shop-border">
<!-- 왼쪽 -->
<div class="category-left">
<h3>카테고리</h3>
<ul>
<li><a href="#">패션의류</a></li>
<li><a href="#">패션잡화</a></li>
<li><a href="#">화장품</a></li>
<li><a href="#">디지털/가전</a></li>
</ul>
</div>
<!-- 오른쪽 -->
<div class="category-right">
<div class="category-right-top">
<div class="category-info">
<span class="headline">인기상품</span>
<h3>
견고함의 차이<br>
세라믹 식탁 세트
</h3>
<span class="price">308,800원</span>
</div>
<div class="image-wrap">
<img src="https://via.placeholder.com/140x160">
</div>
</div>
<div class="category-right-bottom">
<span class="headline">추천태그</span>
<div class="tag-wrap">
<span class="tag">#유아마스크</span>
<span class="tag">#하객원피스</span>
<span class="tag">#멀티밤</span>
<span class="tag">#서큘레이터</span>
<span class="tag">#유아마스크</span>
<span class="tag">#하객원피스</span>
<span class="tag">#멀티밤</span>
<span class="tag">#서큘레이터</span>
</div>
</div>
</div>
</div>
</div>
#shop-main .list-wrap {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: stretch;
}
#shop-main .list-item {
position: relative;
width: 308px;
height: 496px;
background-color: yellow;
margin-bottom: 20px;
}
#shop-main .list-item.banner img {
width: 100%;
height: 100%;
}
#shop-main .list-item .category-wrap {
overflow: hidden;
}
#shop-main .list-item .category-wrap .category-left {
float: left;
width: 124px;
height: 100%;
background-color: #333949;
}
#shop-main .list-item .category-wrap .category-left h3 {
padding: 14px 0 14px 13px;
border-bottom: 1px solid #2b313f;
font-size: 13px;
color: rgba(255, 255, 255, 0.46);
}
#shop-main .list-item .category-wrap .category-left ul {
}
#shop-main .list-item .category-wrap .category-left li {
}
#shop-main .list-item .category-wrap .category-left a {
display: block;
padding: 7px 8px;
font-size: 13px;
color: rgba(255, 255, 255, 0.46);
font-weight: 700;
}
#shop-main .list-item .category-wrap .category-right {
float: right;
width: 182px;
height: 100%;
background-color: #ffffff;
}
#shop-main .list-item .category-wrap .category-right-top {
width: 100%;
height: 306px;
border-bottom: solid 1px #e7e7e7;
text-align: center;
}
#shop-main .list-item .category-wrap .category-right-top .category-info {
padding: 20px 0;
/*text-align: center;*/
}
#shop-main .list-item .category-wrap .category-right-top .headline,
#shop-main .list-item .category-wrap .category-right-bottom .headline {
display: inline-block;
font-size: 12px;
border: solid 1px #00ab33;
color: #00ab33;
margin-bottom: 7px;
}
#shop-main .list-item .category-wrap .category-right-top .category-info h3 {
font-size: 18px;
}
#shop-main .list-item .category-wrap .category-right-top .category-info .price {
font-size: 16px;
color: skyblue;
}
#shop-main .list-item .category-wrap .category-right-top .image-wrap {
/*text-align: center;*/
}
#shop-main .list-item .category-wrap .category-right-bottom {
padding-top: 20px;
text-align: center;
}
#shop-main .list-item .category-wrap .category-right-bottom .tag-wrap .tag {
display: inline-block;
width: auto;
max-width: 75px;
height: 24px;
background-color: #e8eef4;
margin: 6px 1px 0 1px;
padding: 0 5px;
line-height: 26px;
font-size: 11px;
color: #666;
vertical-align: top;
}
<div class="list-item banner">
<div class="w-100 h-100 shop-border">
<img src="https://via.placeholder.com/150x150">
</div>
</div>
#shop-main .list-item.banner img {
width: 100%;
height: 100%;
}
어제와 같이 글꼴이 달라 레이아웃이 틀어지는 문제는 어제와 같이 글꼴크기를 1px 더 작게 하여 해결하였다.
그리고 첫번째 칸에서 css 에 w와 h를 미리 설정해놓고 html 에 적용해야하는데, html 에 적용하지 않아 계속 크기가 다르게 나와 조금 헤매었지만 금방 찾아 문제를 해결하였다.
쇼핑파트로 넘어가서 작업을 하는데 거의 1칸을 채우는데 40분정도가 걸린것같다. 한칸에 이렇게나 오랜시간이 소요된다 생각하니 네이버페이지를 만드는데 총 소요시간이 얼마나 될지 궁금했다.
지금은 내가 생각해놓은 페이지를 만드는것이 아닌 카피캣을 하는 거라 더 시간이 걸리는건지 정말 시간과 집중이 필요한 작업이라는 생각이 든다.
아아아!! 뽜이팅 : )