7月27日Verlog


学習の内容

NAVERブログ実習


https://section.blog.naver.com/BlogHome.naver?directoryNo=0¤tPage=1&groupId=0

0. Default


[html]
<!DOCTYPE html>
<html>

<head>

	<meta charset="utf-8">

	<link rel="stylesheet" type="text/css" href="css/style.css">

	<title>네이버 블로그</title>

</head>

<body></body>

</html>
[css]
.blog_container {
	width: 1080px;
	margin: 0 auto;
}

1. Header


こうぞう


[html]
	<header id="blog_header">
		<div class="blog_header_top"></div>


		<div class="blog_header_nav"></div>		
	</header>

1. blog header top


[html]
		<div class="blog_header_top">
			
			<div class="blog_container">

				<div class="blog_header_left">
					<h1><a href="index.html"><strong>NAVER</strong></a></h1>
					<h2><a href="blog.html">블로그</a></h2>

					<div class="blog_header_input_wrap">
						<div class="blog_search_wrap">
							<input type="text">
							<button type="button" class="btn_search"></button>
						</div>
						<button type="button" class="btn_total_search">통합검색</button>
					</div>
				</div>


				<div class="blog_header_right">
					<a href="#" class="btn_login">로그인</a>
					<button type="button" class="btn_menu"></button>
				</div>

			</div>
		</div>
[css]
#blog_header .blog_header_top {
	height: 60px;
	background-color: #00c73c;

	border-bottom: solid 1px #51b036;
}

#blog_header .blog_header_top .blog_container {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
}

#blog_header .blog_header_top .blog_header_left {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	align-items: center;
}

#blog_header .blog_header_top .blog_header_left h1 {
	font-size: 20px;

	margin-right: 10px;
}

#blog_header .blog_header_top .blog_header_left h1 a {

}

#blog_header .blog_header_top .blog_header_left h1 a strong {
	color: #ffffff;
}

#blog_header .blog_header_top .blog_header_left h2 {
	font-size: 20px;

	margin-right: 20px;
}

#blog_header .blog_header_top .blog_header_left h2 a {
	color: #ffffff;
	font-weight: 700;
}

#blog_header .blog_header_top .blog_header_left .blog_header_input_wrap {
	display: flex;
	flex-wrap: nowrap;
	justify-content: flex-start;
	align-items: center;
}

#blog_header .blog_header_left .blog_header_input_wrap .blog_search_wrap {
	display: flex;
	flex-wrap: nowrap;
	justify-content: flex-start;
	align-items: center;

	width: 325px;
	height: 40px;
	background-color: #ffffff;
	border: solid 1px #4da733;

	margin-right: 5px;
}

#blog_header .blog_header_left .blog_header_input_wrap .blog_search_wrap input {
	width: calc(100% - 40px);
	height: 40px;
	background-color: #ffffff;
	border: none;

	padding: 0 15px;
}

#blog_header .blog_header_left .blog_header_input_wrap .blog_search_wrap input:focus {
	outline: none;
}

#blog_header .blog_header_left .blog_header_input_wrap .blog_search_wrap .btn_search {
	width: 40px;
	height: 40px;
	background-color: #28a93a;
	border: solid 1px #239e36;
}

#blog_header .blog_header_left .blog_header_input_wrap .btn_total_search {
	width: auto;
	height: 40px;
	background-color: #28a93a;
	border: solid 1px #239e36;

	padding: 0 5px;

	line-height: 40px;
	color: #ffffff;
}





#blog_header .blog_header_top .blog_header_right {
	display: flex;
	flex-wrap: nowrap;
	justify-content: flex-end;
	align-items: center;
}

#blog_header .blog_header_top .blog_header_right .btn_login {
	display: inline-block;

	border: solid 1px #239e36;

	padding: 2px 5px;

	color: #ffffff;
	font-size: 12px;
}

#blog_header .blog_header_top .blog_header_right .btn_menu {
	width: 60px;
	height: 60px;
	background-color: #00c73c;
	border-right: solid 1px #239e36;
	border-left: solid 1px #239e36;

	cursor: pointer;

	margin-left: 15px;
}

  • blog header leftとblog header rightのソート
  • blog header left
    ->blog header topはpadding値ではなく、高さ値(height: 60px;)を提供します.
    blog header leftでmargin値を与え、コンテンツの高さを制御します.
  • blog header left,blog header rightソート
    ->親要素に適用されたflexによって中心ソートが行われるため、上に適用されたblog header leftのmargin値は除去されます.

  • buttonラベルのデフォルトはグレーです.
  • cursor: pointer;で領域をクリックすると、カーソルが指の形になります.

  • 2. blog header nav


    [html]
    		<div class="blog_header_nav">
    			<div class="blog_container">
    				<nav class="nav_left">
    					<ul>
    						<li class="on"><a href="#">블로그 홈</a></li>
    						<li><a href="#">주제별 보기</a></li>
    						<li><a href="#">이달의 블로그</a></li>
    						<li><a href="#">공식 블로그</a></li>
    						<li><a href="#">챌린지 프로그램</a></li>
    					</ul>
    				</nav>
    
    				<nav class="nav_right">
    					<ul>
    						<li class="on"><a href="#">블로그 마켓 가입</a></li>
    						<li><a href="#">아이템 팩토리</a></li>
    						<li><a href="#">블로그팀 공식 블로그</a></li>
    					</ul>
    				</nav>
    			</div>
    		</div>		
    [css]
    #blog_header .blog_header_nav {
    	height: 40px;
    	background-color: #ffffff;
    	border-bottom: solid 1px #e5e5e5;
    }
    
    #blog_header .blog_header_nav .blog_container {
    	display: flex;
    	flex-wrap: wrap;
    	justify-content: space-between;
    	align-items: center;
    }
    
    #blog_header .blog_header_nav .nav_left 
    
    
    #blog_header .blog_header_nav .nav_left ul {
    	display: flex;
    	flex-wrap: wrap;
    	justify-content: flex-start;
    	align-items: center;
    }
    
    #blog_header .blog_header_nav .nav_left ul li {
    	height: 40px;
    	border-bottom: solid 3px transparent;
    
    	margin-right: 16px;
    }
    
    #blog_header .blog_header_nav .nav_left ul li.on {
    	border-bottom: solid 3px #00AB33;
    }
    
    #blog_header .blog_header_nav .nav_left ul li.on a {
    	color: #00AB33;
    	font-weight: 700;
    }
    
    #blog_header .blog_header_nav .nav_left ul li a {
    	display: block;
    
    	width: 100%;
    	height: 100%;
    
    	line-height: 40px;
    
    	font-size: 13px;
    }
    
    #blog_header .blog_header_nav .nav_right 
    
    
    #blog_header .blog_header_nav .nav_right ul {
    	display: flex;
    	flex-wrap: wrap;
    	justify-content: flex-end;
    	align-items: center;
    }	
    
    #blog_header .blog_header_nav .nav_right ul li {
    	width: auto;
    	height: 26px;
    
    	margin-left: 5px;
    }
    
    #blog_header .blog_header_nav .nav_right ul li a {
    	display: block;
    
    	width: 100%;
    	height: 100%;
    	background-color: #ffffff;
    	border: solid 1px #cecece;
    
    	line-height: 26px;
    	font-size: 13px;
    
    	padding: 0 10px;
    }
    
    #blog_header .blog_header_nav .nav_right ul li.on a {
    	background-color: #00c73c;
    	border: solid 1px rgba(0, 0, 0, 0.07);
    
    	color: #ffffff;
    }
  • border-bottom: solid 3px transparent; , border-bottom: solid 3px #00AB33;:ヒント
  • 、liラベルにカラータグを1つだけ入れても、整列が乱れないようにすることができます

    2. Main


    こうぞう


    [html]
    	<main role="main" id="blog_main">
    		
    		<div id="hot_topic"></div>
    
    
    
    
    
    		<div id="blog_main_content" class="blog_container">
            		<div class="blog_main_left"></div>
    			<div class="blog_main_right"></div>
                	</div>
    
    
    	</main>
    [css]
    #blog_main {
    	padding-top: 0px;
    }

    3. Main - Hot Topic


    [html]
    		<div id="hot_topic">
    			<div class="blog_container">
    				
    				<div class="hot_topic_left">
    					<div class="topic_heading">
    						<h3>핫토픽</h3>
    						<i></i>
    						<a href="#">다꾸를 해요</a>
    					</div>
    
    					<ul class="topic_lists">
    						<li>
    							<img src="https://via.placeholder.com/252x240">
    							<p>초보 다꾸러의 다꾸 팁<br>공개!</p>
    						</li>
    						<li>
    							<img src="https://via.placeholder.com/252x240">
    							<p>초보 다꾸러의 다꾸 팁<br>공개!</p>
    						</li>
    						<li>
    							<img src="https://via.placeholder.com/252x240">
    							<p>초보 다꾸러의 다꾸 팁<br>공개!</p>
    						</li>
    					</ul>
    
    					<div class="pagination_wrap">
    						<a href="#">1</a>
    						<a href="#">2</a>
    						<a href="#">3</a>
    						<a href="#">4</a>
    						<a href="#">5</a>
    					</div>
    				</div>
    
    
    				<div class="hot_topic_right">
    					<div class="topic_banner"></div>
    
    					<div class="pagination_wrap">
    						<a href="#">1</a>
    						<a href="#">2</a>
    						<a href="#">3</a>
    						<a href="#">4</a>
    						<a href="#">5</a>
    					</div>
    				</div>
    
    			</div>
    		</div>
    [css]
    #blog_main #hot_topic {
    	height: 305px;
    	background-color: #f5f5f6;
    
    	padding: 20px 0 15px;
    }
    
    #blog_main #hot_topic .blog_container {
    	display: flex;
    	flex-wrap: wrap;
    	justify-content: space-between;
    	align-items: center;
    }
    
    #blog_main #hot_topic .hot_topic_left {
    	position: relative;
    
    	width: 770px;
    }
    
    #blog_main #hot_topic .hot_topic_left .topic_heading {
    	display: flex;
    	flex-wrap: wrap;
    	justify-content: flex-start;
    	align-items: center;
    
    	margin-bottom: 11px;
    }
    
    #blog_main #hot_topic .hot_topic_left .topic_heading h3 {
    	font-size: 16px;
    	font-weight: 600;
    	color: #e55e5e;
    }
    
    #blog_main #hot_topic .hot_topic_left .topic_heading i {
    	display: block; -> 기본적으로 i 태그는 inline 요소라서 공간을 만들 수 없다.
    
    	width: 8px;
    	height: 13px;
    	background-color: grey;
    
    	margin: 0 8px;
    }
    
    #blog_main #hot_topic .hot_topic_left .topic_heading a {
    	font-size: 16px;
    }
    
    #blog_main #hot_topic .hot_topic_left .topic_lists {
    	display: flex;
    	flex-wrap: wrap;
    	justify-content: space-between;
    	align-items: center;
    }
    
    #blog_main #hot_topic .hot_topic_left .topic_lists li {
    	position: relative;
    
    	width: 252px;
    	height: 240px;
    }
    
    #blog_main #hot_topic .hot_topic_left .topic_lists li img {
    	position: absolute;
    
    	width: 100%;
    	height: 100%;
    }
    
    #blog_main #hot_topic .hot_topic_left .topic_lists li p {
    	position: absolute;
    
    	width: 100%;
    	background-color: rgba(55, 66, 87, 0.9);
    
    	bottom: 0; -> 부모 요소인 li 태그에서 가장 아래
    
    	color: #ffffff;
    	text-align: center; -> 텍스트 영역 내에서 센터 정렬
    
    	padding: 20px 0;
    }
    
    #blog_main #hot_topic .pagination_wrap {
    	position: absolute;
    
    	display: flex;
    	flex-wrap: wrap;
    	justify-content: flex-end;
    	align-items: center;
    
    	top: 0;
    	right: 0;
    }
    
    #blog_main #hot_topic .pagination_wrap a {
    	display: block;
    
    	width: 20px;
    	height: 20px;
    	background-color: #f6f6f7;
    	border: solid 1px rgba(221, 221, 223, 0.8);
    
    	color: #888;
    	font-size: 12px;
    	text-align: center;
    	line-height: 20px;
    
    	margin-left: 4px;
    }
    
    
    
    
    
    #blog_main #hot_topic .hot_topic_right {
    	position: relative;
    
    	width: 280px;
    
    	padding-top: 30px; -> topic_lists와 높이 맞춰줌
    }
    
    #blog_main #hot_topic .hot_topic_right .topic_banner {
    	width: 280px;
    	height: 240px;
    	background-color: black;
    }
  • の位置と下部を使用して、imgラベルとpラベルを重ねて並べ替えます.
    :親要素liの位置->相対
    :サブエレメントimg,pのposition->絶対

  • HEX色コードの使用(注意:http://hex2rgba.devoth.com/)
    : background-color: #374257; + opacity: 0.9;-> background-color: rgba(55, 66, 87, 0.9);

  • 改ページ行揃え(左/右共通)
    (1)親要素hot topic left:position: relative;(2) pagination_wrap : position: absolute; + top: 0; + right: 0;
  • ※aラベル単独または余白付与時は、display:block;に変換して使用することが多い.

    4. Main Left


    [html]
    			<div class="blog_main_left">
    				
    				<div id="blog_main_notification">
    					<p>
    						로그아웃 상태입니다.<br>
    						로그인하여 이웃 새글을 확인해보세요.
    					</p>
    				</div>
    
    
    				<div id="blog_article">
    					<nav class="blog_article_nav">
    						<ul>
    							<li><a href="#">전체</a></li>
    							<li><a href="#">음악</a></li>
    							<li><a href="#">사진</a></li>
    							<li><a href="#">취미</a></li>						
    						</ul>
    					</nav>
    
    					<ul class="blog_article_lists">
    						<li>
    							<a href="#">
    								<div class="blog_article_info">
    									<div class="blog_profile_wrap">
    										<img src="https://via.placeholder.com/32x32">
    
    										<div class="blog_profile_info">
    											<h3>류영서</h3>
    											<p>13시간 전</p>
    										</div>
    									</div>
    
    									<h2>Title 1</h2>
    									<p class="paragraph">동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 </p>
    
    									<div class="comments">
    										<span>공감 <em>46</em></span>
    										<span>댓글 <em>11</em></span>
    									</div>
    								</div>
    
    								<img src="https://via.placeholder.com/167x167">
    							</a>
    						</li>
    						<li>
    							<a href="#">
    								<div class="blog_article_info">
    									<div class="blog_profile_wrap">
    										<img src="https://via.placeholder.com/32x32">
    
    										<div class="blog_profile_info">
    											<h3>류영서</h3>
    											<p>13시간 전</p>
    										</div>
    									</div>
    
    									<h2>Title 1</h2>
    									<p class="paragraph">동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 </p>
    
    									<div class="comments">
    										<span>공감 <em>46</em></span>
    										<span>댓글 <em>11</em></span>
    									</div>
    								</div>
    
    								<img src="https://via.placeholder.com/167x167">
    							</a>
    						</li>
    						<li>
    							<a href="#">
    								<div class="blog_article_info">
    									<div class="blog_profile_wrap">
    										<img src="https://via.placeholder.com/32x32">
    
    										<div class="blog_profile_info">
    											<h3>류영서</h3>
    											<p>13시간 전</p>
    										</div>
    									</div>
    
    									<h2>Title 1</h2>
    									<p class="paragraph">동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 </p>
    
    									<div class="comments">
    										<span>공감 <em>46</em></span>
    										<span>댓글 <em>11</em></span>
    									</div>
    								</div>
    
    								<img src="https://via.placeholder.com/167x167">
    							</a>
    						</li>
    						<li>
    							<a href="#">
    								<div class="blog_article_info">
    									<div class="blog_profile_wrap">
    										<img src="https://via.placeholder.com/32x32">
    
    										<div class="blog_profile_info">
    											<h3>류영서</h3>
    											<p>13시간 전</p>
    										</div>
    									</div>
    
    									<h2>Title 1</h2>
    									<p class="paragraph">동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 </p>
    
    									<div class="comments">
    										<span>공감 <em>46</em></span>
    										<span>댓글 <em>11</em></span>
    									</div>
    								</div>
    
    								<img src="https://via.placeholder.com/167x167">
    							</a>
    						</li>
    						<li>
    							<a href="#">
    								<div class="blog_article_info">
    									<div class="blog_profile_wrap">
    										<img src="https://via.placeholder.com/32x32">
    
    										<div class="blog_profile_info">
    											<h3>류영서</h3>
    											<p>13시간 전</p>
    										</div>
    									</div>
    
    									<h2>Title 1</h2>
    									<p class="paragraph">동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 </p>
    
    									<div class="comments">
    										<span>공감 <em>46</em></span>
    										<span>댓글 <em>11</em></span>
    									</div>
    								</div>
    
    								<img src="https://via.placeholder.com/167x167">
    							</a>
    						</li>
    					</ul>
    				</div>
    
    
    			</div>
    [css]
    #blog_main #blog_main_content {
    	display: flex;
    	flex-wrap: wrap;
    	justify-content: space-between;
    }
    
    #blog_main #blog_main_content .blog_main_left {
    	width: 770px;
    }
    
    #blog_main #blog_main_content .blog_main_left #blog_main_notification {
    	background-color: #ffffff;
    
    	text-align: center;
    
    	padding: 54px 0;
    }
    
    #blog_main #blog_main_content .blog_main_left #blog_main_notification p {
    	font-size: 16px;
    	line-height: 30px;
    }
    
    #blog_main #blog_main_content .blog_main_left #blog_article 
    
    
    #blog_main #blog_main_content .blog_main_left #blog_article .blog_article_nav {
    	background-color: #ffffff;
    	border-top: solid 2px #999999;
    	border-bottom: solid 2px #999999;
    
    	padding: 10px 0;
    
    	font-size: 14px;
    }
    
    .blog_main_left #blog_article .blog_article_nav ul {
    	display: flex;
    	flex-wrap: wrap;
    	justify-content: flex-start;
    	align-items: center;
    }
    
    .blog_main_left #blog_article .blog_article_nav ul li {
    	margin-right: 22px;
    }
    
    
    
    #blog_main #blog_main_content .blog_main_left #blog_article .blog_article_lists 
    
    
    #blog_article .blog_article_lists li {
    	width: 100%;
    	/*height: 172px;*/
    	border-bottom: solid 1px #eeeeef;
    
    	padding: 25px 0 23px;
    }
    
    #blog_article .blog_article_lists li a {
    	display: block;
    
    	display: flex;
    	flex-wrap: wrap;
    	justify-content: space-between;
    	align-items: center;
    
    	width: 100%;
    	height: 100%;
    }
    
    #blog_article .blog_article_lists li a .blog_article_info {
    	width: 573px;
    }
    
    #blog_article .blog_article_lists .blog_article_info .blog_profile_wrap {
    	display: flex;
    	flex-wrap: wrap;
    	justify-content: flex-start;
    	align-items: center;
    }
    
    #blog_article .blog_article_lists .blog_article_info .blog_profile_wrap img {
    	width: 32px;
    	height: 32px;
    	border-radius: 50%; -> 원형으로 바꿔줌
    
    	margin-right: 10px;
    }
    
    #blog_article .blog_article_lists .blog_article_info .blog_profile_wrap .blog_profile_info {
    
    }
    
    #blog_article .blog_article_lists .blog_article_info .blog_profile_info h3 {
    	font-size: 14px;
    
    	margin-bottom: 3px;
    }
    
    #blog_article .blog_article_lists .blog_article_info .blog_profile_info p {
    	font-size: 11px;
    	color: #959595;
    }
    
    
    #blog_article .blog_article_lists .blog_article_info h2 {
    	font-size: 17px;
    
    	margin-top: 16px;
    }
    
    #blog_article .blog_article_lists .blog_article_info .paragraph {
    	color: #666666;
    	font-size: 13px;
    
    	margin-top: 10px;
    }
    
    
    #blog_article .blog_article_lists .blog_article_info .comments {	
    	color: #959595;
    	font-size: 12px;
    
    	margin-top: 14px;
    }
    
    #blog_article .blog_article_lists .blog_article_info .comments span {
    	margin-right: 9px;
    }
    
    #blog_article .blog_article_lists .blog_article_info .comments span em {
    	font-style: normal;
    }