2021년 7월 21일 18일차

신종원·2021년 7월 21일
0

학습한 내용

html - shop

네이버
<link rel="stylesheet" type="text/css" href="css/style.css">
<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>

<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>
			<div class="list_item banner">
				<div class="w-100 h-100 shop_border">
					<img src="https://via.placeholder.com/150x150">
				</div>
			</div>
			<div class="list_item"></div>
			<div class="list_item"></div>
			<div class="list_item"></div>
			<div class="list_item"></div>
			<div class="list_item"></div>
			<div class="list_item"></div>
		</div>
	</div>
</main>

css

  • {
    margin: 0;
    padding: 0;

    box-sizing: border-box;

    }

ol, ul {
list-style: none;
}
/ol : 앞에 숫자가 붙음
ul : 앞에 점이 붙음
-> 이것들을 주지 않겠다.
/

a {
text-decoration: none;
color: #000000;
}
/글자의 밑줄을 주지 않고, 파란색이 기본적으로 나오지만 검은색으로 나오게 한다./

img {
vertical-align: middle;
}
/이미지 하단에 있는 공백을 제거해 주겠다./

button {
border: none;
}
/버튼 주위 테두리를 없애겠다./

input, textarea {
outline: none;
}

.clearfix {
clear: both;
}

.container {
width: 1130px;
margin: 0 auto;
}
/너비 1130px, 중앙정렬/

#main_header {
position: relative;
background-color: #ffffff;
}

#main_header .search_area {
display: flex;
justify-content: center;
align-items: center;
/http://flexbox.help//
position: relative;

height: 160px;
background-color: #ffffff;

border-bottom: 1px solid #e4e8eb;

}

#main_header .search_wrap {
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;

position: relative;
width: 582px;
height: 52px;
border: solid 2px #19ce60;

}

#main_header .search_wrap input {
width: calc(100% - 52px);
height: 100%;
padding: 13px 15px;

font-size: 22px;
border: none;

}

#main_header .search_wrap input:focus {
outline: none;
}
/focus : 입력하는 칸에 입력을 하면 테두리가 생기는데 -> 테두리를 없애겠다./

#main_header .search_wrap button {
width: 52px;
height: 100%;
/위의 search_wrap에서 height의 값을 52px을 주었기 때문에 52px/
background-color: #19ce60;
}

#main_header #navbar {
box-shadow: 0 1px 3px 0 rgb(0, 0, 0 / 12%);
/https://cssgenerator.org/box-shadow-css-generator.html/
}

#main_header #navbar ul {
padding: 11px 0;
}

#main_header #navbar ul li {
display: inline-block;
margin-right: 5px;
}

#main_header #navbar ul li a {
color: #03c75a;
font-size: 15px;
font-weight: 700;
}

main {
overflow: hidden;
padding-top: 20px;
}

main #main_left {
float: left;
width: 750px;
}

main #main_right {
float: right;
width: 350px;
}

main #banner_wrap {
width: 750px;
height: 135px;
background-color: #000000;

margin-bottom: 12px;

}

main #news_wrap .news_header {
display: flex;
flex-wrap: rap;
justify-content: space-between;
align-items: center;

padding: 22px 0 16px 0;

}

main #news_wrap .news_header h2 {
font-size: 14px;
font-weight: 700px;
}

main #news_wrap .news_header .news_btn_wrap {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;

width: 60px;

}
main #news_wrap .news_header .news_btn_wrap button {
width: 15px;
height: 15px;
background-color: blue;
}

main #news_wrap .news_lists {
overflow: hidden;
border: solid 1px #dae1e6;
}

main #news_wrap .news_lists .news_list {
position: relative;
float: left;
width: 16.66%;
/list가 가로6개라서 100에서 6을 나누면 16.66%/
height: 65px;
background-color: #ffffff;

border-bottom: solid 1px #e4e8eb;
border-right: solid 1px #e4e8eb;

text-align: center;

}

main #news_wrap .news_lists .news_list:nth-child(6n) {
border-right: none;
}

main #news_wrap .news_lists .news_list:nth-child(19),
main #news_wrap .news_lists .news_list:nth-child(20),
main #news_wrap .news_lists .news_list:nth-child(21),
main #news_wrap .news_lists .news_list:nth-child(22),
main #news_wrap .news_lists .news_list:nth-child(23),
main #news_wrap .news_lists .news_list:nth-child(24) {
border-bottom: none;
}

main #news_wrap .news_lists .news_list img {
position: relative;

top: 50%;
transform: translateY(-50%);
/*y축 중앙정렬*/

}
main #blog_wrap {
padding-top: 35px;
}

main #blog_wrap .blog_header {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;

padding-bottom: 17px;

}

main #blog_wrap .blog_header .left_header {
display: flex;
flex-wrap: wrap;
align-items: center;
}

main #blog_wrap .blog_header .left_header h3 {
font-size: 14px;
margin-right: 8px;
}

main #blog_wrap .blog_header .left_header span {
font-size: 12px;
color: gray;
}

main #blog_wrap .blog_header .right_header {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
align-items: center;
}

main #blog_wrap .blog_header .right_header span {
font-size: ;12px
color: gray;
}

main #blog_wrap .blog_header .right_header .count strong {
color: #000000;
}

main #blog_wrap .blog_nav ul {
overflow: hidden;
border: solid 1px #eae1e6;
}

main #blog_wrap .blog_nav ul li {
float: left;
width: 12.5%;
height: 49px;
border-right: solid 1px #eae1e6;
}

main #blog_wrap .blog_nav ul li:last-child {
border-right: 0;
}

main #blog_wrap .blog_nav ul li a {
display: block;
width: 100%;
height: 100%;

line-height: 49px;
text-align: center; 

}

main #blog_wrap .blog_list_wrap {
padding-top: 18px;
border-bottom: solid 1px #dae1e6;
}

main #blog_wrap .blog_list_wrap li {
margin-bottom: 18px;
}

main #blog_wrap .blog_list_wrap li a {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
align-items: center;
}

main #blog_wrap .blog_list_wrap li img {
width: 170px;
height: 114px;
margin-right: 21px;
}

main #blog_wrap .blog_list_wrap li .blog_list_info {
width: 559px;
padding-left: 47px;
}

main #blog_wrap .blog_list_wrap li .blog_list_info span {
font-size: 12px;
color: #35ae5e;
}

main #blog_wrap .blog_list_wrap li .blog_list_info h4 {
font-size: 13px;
}

main #blog_wrap .blog_list_wrap li .blog_list_info p {
font-size: 13px;
}

main #blog_wrap .blog_list_wrap li .blog_list_info .date_wrap span {
color: #505050;
}

main #blog_wrap .blog_media_wrap ul {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;

padding: 18px 0;

border-bottom: solid 1px #dae1e6;

}

main #blog_wrap .blog_media_wrap ul .blog_media_info {
padding-top: 12px;
}

main #blog_wrap .blog_media_wrap ul .blog_media_info h4 {
font-size: 13px;
}

main #blog_wrap .blog_media_wrap ul .blog_media_info span {
font-size: 12px;
}
/--------------------------------------------------------/

#main_right #account {
width: 100%;
border: solid 1px #dae1e6;
padding: 16px 16px 12px 16px;
margin-bottom: 12px;
}

#main_right #account p {
font-size: 12px;
padding-left: 3px;
margin-bottom: 11px;
}

#main_right #account a {
display: block;
width: 100%;
background-color: #19ce60;
border-radius: 2px;

padding: 15px 0;
margin-bottom: 14px;

text-align: center;
font-size: 13px;
color: #fff;
font-weight: 700;

}

#main_right #account .account_sub {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;

padding: 0 8px;

}

#main_right #account .account_sub span {
font-size: 12px;
}

#main_right #banner {
width: 348px;
height: 198px;
background-color: #000000;

margin-bottom: 20px;

}

#main_right #shop_wrap .shop_title {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;

padding: 12px 0;

}

#main_right #shop_wrap .shop_title h3,
#main_right #shop_wrap .shop_title h4 {
font-size: 13px;
}

#main_right #shop_wrap .shop_title h4 {
margin-left: 15px;
}

#main_right #shop_wrap .shop_title .right {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
align-items: center;
}

#main_right #shop_wrap .shop_content {
border: solid 1px #e4e8eb;
padding: 0 0 22px ;
}

#main_right #shop_wrap .shop_content .shop_goods {
padding:55px 8px;
}
#main_right #shop_wrap .shop_content .commerce_lists {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;

padding: 12px 4px;
background-color: #f7f9fa;
border-bottom: solid 1px #dae126;

}
#main_right #shop_wrap .shop_content .commerce_lists li {
font-size: 12px;
margin-left: 10px;
margin-bottom: 5px;

}

#main_right #shop_wrap .shop_content .commerce_lists li:nth-child(1),
#main_right #shop_wrap .shop_content .commerce_lists li:nth-child(9) {
margin-left: 0;
}

#main_right #shop_wrap .product_lists {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
}
#main_right #shop_wrap .product_lists li {
margin-bottom: 10px;
}

#main_right #shop_wrap .product_lists .product_info {
text-align: center;
}

#main_right #shop_wrap .product_lists h3,
#main_right #shop_wrap .product_lists span {
font-size: 12px;
}

#main_footer {
background-color: #fafbfc;
border-top: solid 1px #e4e8eb;
padding-bottom: 92px;
}

#main_footer .news_lists {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;

padding: 24px 0;

}

#main_footer .news_lists li {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
align-items: center;
}

#main_footer .news_lists li img {
margin-right: 15px;
}

#main_footer .news_lists li .news_info {
width: 172px;
}

#main_footer .news_lists li .news_info span,
#main_footer .news_lists li .news_info h3,
#main_footer .news_lists li .news_info p {
font-size: 13px;
}

#main_footer .news_lists li .news_info span {
color: #58c464;
}

#main_footer .corp_lists {
padding-top: 25px;
border-top: solid 1px #e4e8eb;
}

#main_footer .corp_lists li {
display: inline-block;
vertical-align: middle;
}

#main_footer .corp_lists li:first-child:before {
content: initial;
}
/맨앞에있는 li태그의 앞 막대기는 지우겠다./

#main_footer .corp_lists li:before {
content: "";
display: inline-block;
width: 1px;
height: 11px;
background-color: #e4e8eb;
margin: 0 8px;

vertical-align: -1px;

}

#main_footer .corp_lists li a {
font-size: 12px;
}

/--------- 쇼핑 페이지 ---------/

#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 #e8e8e8e8;
border-bottom: solid 1px #e8e8e8e8;
}

#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;
}
#shop_main .list_wrap {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: stretch;
}
#shop_main .list_item {
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 {
padding: ;
}

#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 .category_right_top {
width: 100%;
height: 306px;
border-bottom: solid 1px #e7e7e7;
}

#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: 12px;
color: #666;
vertical-align: top;

}

결과물

오늘은 naver 쇼핑 카피캣을 진행하였다.

학습내용 중 어려웠던 점

오늘 수업은 어렵기 보다는 헷갈리는 점들이 많았다.
왜 얘들은 크기를 이렇게 하는지, 왜 이 태그를 사용하는지에 대한 의문이 많았따.

해결방법

css와 html 구조와 코딩을 하는데는 정답이 없다.
여러가지 방법이 존재하는데, 나에게 맞는 코딩을 찾으면 될 것 같다.

학습소감

아직까지는 배움이 많이 부족 한것 같다.
많은 복습을 통해 실력을 키워나가야 할 것 같다.

profile
나는 돈 많이 버는 개발자가 될 것이다.

0개의 댓글