

position : absolute;
position : relative;
position : fixed;
top : , right : , bottom : , left :
absolute와 relative의 차이가 뭘까?
list-style : none // • 없애기
list-style : square // 네모로 변경하기
등등..
nav li span:first-child {
display: inline-block;
background-image: url("./sp_nav.png");
background-repeat: no-repeat;
height: 16px;
}
nav li:first-child span:first-child {
width: 25px;
background-position: 0 -285px;
}
nav li:nth-child(2) span:first-child {
width: 27px;
background-position: -279px -52px;
}
<!DOCTYPE html>
<html lang="ko">
<head>
<!-- meta태그는 문서에 대한 정보를 나타냄 -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>네이버</title>
<!-- 파비콘 -->
<link rel="shortcut icon" type="image/x-icon" href="image/favicon.ico">
<link rel="stylesheet" href="./naver.css">
</head>
<body>
<header>
<div class="center-align"> <!-- 가운데 정렬용 div -->
<!-- 속성명: 속성값; 속성명2: 속성값2 -->
<span>네이버를 시작페이지로</span>
<span>쥬니어네이버</span>
<span>해피빈</span>
<!-- <div style="display : inline-block">네이버를 시작페이지로</div>
<div style="display : inline-block">쥬니어네이버</div>
<div style="display : inline-block">해피빈</div> -->
<div id="header-search">
<!-- href 는 a태그의 부가정보 속성(attribute) -->
<a href="https://www.naver.com">
<h1>
<span>네이버</span>
</h1>
</a>
<h2 class="blind">검색창</h2>
<fieldset>
<input type="text">
<button>
<span class="blind">검색</span>
<span id="search-image"></span>
</button>
</fieldset>
</div>
</div>
</header>
<nav>
<div class="center-align">
<ul> <!-- unordered list --> <!-- ol태그도 있음 ordered list -->
<li><a href=""><span></span><span class="blind">메일</span></a></li> <!-- list item -->
<li><a href=""><span></span><span class="blind">카페</span></a></li> <!-- list item -->
<li><a href=""><span></span><span class="blind">블로그</span></a></li> <!-- list item -->
<li><a href=""><span></span><span class="blind">지식인</span></a></li> <!-- list item -->
<li><a href=""><span></span><span class="blind">쇼핑</span></a></li> <!-- list item -->
<li><a href=""><span></span><span class="blind">네이버페이</span></a></li> <!-- list item -->
<li><a href=""><span></span><span class="blind">네이버쇼핑</span></a></li> <!-- list item -->
</ul>
</div>
</nav>
<main>
<h2>실시간 검색어</h2>
<h3>연합뉴스</h3>
<ol>
<li>프론트엔드</li>
<li>할수있다</li>
<li>굿굿</li>
</ol>
<h3>언론사 목록</h3>
<ul>
<li><img src="image/서울신문.png" alt="서울신문"></li>
<li><img src="image/스포티비.png" alt="스포티비"></li>
</ul>
<h3>로그인</h3>
<h3>뉴스</h3>
<h3>법률</h3>
<h3>쇼핑</h3>
</main>
<footer>
<div>공지</div>
<div>creaters</div>
<div>회사소개</div>
</footer>
</body>
</html>
/* *은 모든 태그 의미 */
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
padding: 0;
}
/* 선택자 (selector) */
.blind {
position: absolute;
clip: rect(0 0 0 0);
width: 1px;
height: 1px;
margin: -1px;
overflow: hidden;
}
.center-align {
margin: 0 auto;
width: 1080px;
}
/* 자식 선택자 */
div#header-search h1 {
width: 198px;
height: 48px;
display: inline-block;
/* background-image: url('./sp_search.png');
background-position: -4px -10px;
background-repeat: no-repeat; */
background: url('./sp_search.png') -4px -4px no-repeat;
vertical-align: middle;
position: relative;
top: -4px;
}
#header-search a {
text-decoration: none;
vertical-align: middle;
}
#header-search h1 span {
display: none;
}
div#header-search h2 {
display: none;
}
div#header-search fieldset {
margin-left: 20px;
padding: 12px 0px 12px 10px;
border: 2px solid #03cf5d;
width: 521px;
height: 49px;
display: inline-block;
vertical-align: middle;
position: relative;
}
#header-search fieldset input {
border: none;
padding: 0;
outline: none;
width: 405px;
height: 23px;
vertical-align: top;
}
#header-search fieldset button {
width: 49px;
height: 49px;
border: none;
padding: 0;
background: #03cf5d;
position: absolute;
right: -2px;
top: -2px;
}
#search-image {
background-image: url(./sp_search.png);
background-position: -3px -60px;
background-repeat: no-repeat;
width: 21px;
height: 21px;
display: inline-block;
margin: 14px;
}
nav ul {
margin: 0;
padding: 0;
list-style: none;
}
nav li {
display: inline-block;
}
nav li span:first-child {
display: inline-block;
background-image: url("./sp_nav.png");
background-repeat: no-repeat;
height: 16px;
margin-left: 14px;
}
nav li:first-child span:first-child {
width: 25px;
background-position: 0 -285px;
margin-left: 0;
}
nav li:nth-child(2) span:first-child {
width: 27px;
background-position: -279px -52px;
}
nav li:nth-child(3) span:first-child {
width: 40px;
background-position: -100px -182px;
}
nav li:nth-child(4) span:first-child {
width: 40px;
background-position: -101px -156px;
}
nav li:nth-child(5) span:first-child {
width: 26px;
background-position: -279px -156px;
}
nav li:nth-child(6) span:first-child {
width: 25px;
background-position: -70px -285px;
}
/*
div#header-center h1 {
자손 선택자
}
*/