<!DOCTYPE html>
<html>
<head>
<title>Dropdown Navbar</title>
<style>
.navbar {
overflow: hidden;
background-color: #333;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropdown_btn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropdown_btn {
background-color: #f25e13;
}
.dropdown_menu {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown_menu a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown_menu a:hover {
background-color: #f25e13;
color: white;
}
.dropdown:hover .dropdown_menu {
display: block;
}
</style>
</head>
<body>
<div class="navbar">
<a href="#home">Home</a>
<a href="#contact">Contact Us</a>
<div class="dropdown">
<button class="dropdown_btn">Dropdown Menu
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown_menu">
<a href="#">Sub Menu 1</a>
<a href="#">Sub Menu 2</a>
<a href="#">Sub Menu 3</a>
</div>
</div>
</div>
</body>
</html>