학습한 내용
[html]
<div id="wrapper">
<nav id="youtube_top_nav"></nav>
<nav id="youtube_left_nav">
<div id="youtube_left_content"></div>
</nav>
<main role="main" id="youtube_main"></main>
</div>
[css]
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
width: 100%;
height: 100%;
}
ol, ul {
list-style: none;
}
a {
text-decoration: none;
}
img {
vertical-align: top;
}
button {
background: transparent;
border: none;
}
input {
border: none;
outline: none;
}
input:focus {
outline: none;
}
.flex_between {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
}
.flex_start {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
align-items: center;
}
.flex_center {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
}
.flex_end {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
align-items: center;
}
#wrapper {
position: relative;
width: 100%;
height: 100%;
min-width: 1320px;
}
[html]
<nav id="youtube_top_nav" class="flex_between">
<div class="nav_left"></div>
<div class="nav_center"></div>
<div class="nav_right"></div>
</nav>
[css]
#youtube_top_nav {
position: fixed;
width: 100%;
height: 56px;
background-color: #202020;
padding: 0 16px;
}
[html]
<div class="nav_left flex_start">
<button class="btn_menu" type="button"></button>
<h1>
<a href="#">
<img src="https://via.placeholder.com/90x20">
</a>
</h1>
</div>
[css]
#youtube_top_nav .nav_left {
height: 56px;
}
#youtube_top_nav .nav_left .btn_menu {
width: 24px;
height: 24px;
background-color: #b2b2b2;
margin-left: 8px;
margin-right: 24px;
}
#youtube_top_nav .nav_left h1 a img {
width: 90px;
height: 20px;
vertical-align: initial;
/*초기화로 top으로 지정되어 있음*/
}
[html]
<div class="nav_center flex_start">
<div class="search_wrap flex_between">
<input type="text" placeholder="검색">
<button class="btn_search" type="button"></button>
</div>
<button class="btn_voice" type="button"></button>
</div>
[css]
#youtube_top_nav .nav_center {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
#youtube_top_nav .nav_center .search_wrap {
overflow: hidden;
width: 640px;
height: 30px;
border-radius: 2px;
}
#youtube_top_nav .nav_center .search_wrap input {
width: calc(100% - 65px);
height: 30px;
background-color: #121212;
border: solid 1px #2c2c2c;
padding: 2px 6px;
font-size: 14px;
}
#youtube_top_nav .nav_center .search_wrap input:focus {
color: #fff;
}
#youtube_top_nav .nav_center .search_wrap .btn_search {
width: 65px;
height: 30px;
background-color: #313131;
border: solid 1px #313131;
}
#youtube_top_nav .nav_center .btn_voice {
width: 24px;
height: 24px;
background-color: #fff;
border-radius: 50%;
margin-left: 12px;
}
[html]
<div class="nav_right flex_end">
<button class="btn_menu btn_menu_1" type="button"></button>
<button class="btn_menu btn_menu_2" type="button"></button>
<a href="#" class="btn_login">로그인</a>
</div>
[css]
#youtube_top_nav .nav_right {
height: 56px;
}
#youtube_top_nav .nav_right .btn_menu {
width: 24px;
height: 24px;
background-color: #b3b3b3;
margin: 8px;
margin-right: 16px;
}
#youtube_top_nav .nav_right .btn_login {
border: solid 1px #3ea6ff;
border-radius: 2px;
padding: 8px 12px;
font-size: 14PX;
color: #3ea6ff;
}