2018.12.05 메뉴디자인하기

2018. 12. 5. 16:37HTML5&CSS

#1 메뉴 디자인하기

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>메뉴 만들기</title>
<style>
*{margin: 0; padding: 0;}
nav ul{
list-style-type: none;
}
nav ul .list{
/* display: table-cell; */
/* display: inline-block; */
float: left;
}
nav ul .list a{
padding:0 10px;
text-decoration: none;
color: brown;
}
nav ul::after{
content: "";
clear: both;
display: block;
}
.dropdown{
display: none;

}
/* .class:hover .class/child{diplay:block;}→ 마우스가 근접했을 때 반응하게 만들어줌 */
.list:hover .dropdown{
display: block;
}
</style>
</head>
<body>
<nav>
<ul>
<li class="list"><a href="#">HOME</a></li>
<li class="list"><a href="#">Products</a>
<ul class="dropdown">
<li><a href="#">Sliders</a></li>
<li><a href="#">Galleries</a></li>
<li><a href="#">Apps</a></li>
<li><a href="#">Extensions</a></li>
</ul>
</li>
<li class="list"><a href="#">Company</a></li>
<li class="list"><a href="#">Address</a></li>
</ul>
</nav>
</body>
</html>