html CSS 및 HTML을 사용하여 드롭다운 탐색 메뉴를 만드는 방법
<!DOCTYPE html>
<html lang="en">
<head>
<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>Responsive Personal Portfolio Website Design | Codehal</title>
<!-- box icons -->
<link href="https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css" rel="stylesheet" />
<!-- custom css -->
<link rel="stylesheet" href="css/style.css" />
<style>
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap");
body{
margin: 0;
padding: 0;
font-family:poppins;
background: url("https://i.postimg.cc/zfn5wLYT/2.jpg");
-webkit-background-size: cover;
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
height: 100vh;
}
a{
font-size: 12px;
text-transform: uppercase;
}
.nav-area{
background: #262626;
}
.nav-area:after{
content: '';
clear: both;
display: block;
}
.nav-area ul{
list-style: none;
margin: 0;
}
.nav-area > ul > li{
float: left;
position: relative;
}
.nav-area ul li a{
text-decoration: none;
color: #fff;
padding: 15px 20px;
display: block;
}
.nav-area ul li:hover a{
background: #34495e;
}
.nav-area ul ul{
position: absolute;
padding: 0;
min-width: 160px;
display: none;
top: 100%;
left: 0;
}
.nav-area ul li:hover > ul{
display: block;
}
.nav-area ul ul li:hover a{
background: #262626;
}
.nav-area ul ul li{
position: relative;
}
.nav-area ul ul ul{
top: 0;
left: 100%;
}
.nav-area ul ul ul li:hover a{
background: #34495e;
}
</style>
<nav class="nav-area">
<ul>
<li><a href="#">home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a>
<ul>
<li><a href="#">Web Design</a></li>
<li><a href="#">Web Development</a></li>
<li><a href="#">Email Marketing</a></li>
<li><a href="#">Graphics Design</a>
<ul>
<li><a href="#">Logo Design</a></li>
<li><a href="#">Card Design</a></li>
<li><a href="#">Poster Design</a></li>
<li><a href="#">Template Design</a>
<ul>
<li><a href="#">Web Template</a></li>
<li><a href="#">Email Template</a></li>
<li><a href="#">News Template</a></li>
<li><a href="#">Bio Template</a></li>
<li><a href="#">Wedding Template</a></li>
</ul>
</li>
<li><a href="#">Brochure Design</a></li>
</ul>
</li>
<li><a href="#">SEO</a></li>
</ul>
</li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
html