Program:
Output:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS DropDown</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="bootstrap/css/font-awesome.min.css">
<style>
body {
font-family: Arial, sans-serif;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown_list {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
padding: 12px 16px;
z-index: 1;
}
.dropdown_button {
background-color: #4CAF50;
color: white;
padding: 16px;
font-size: 16px;
border: none;
cursor: pointer;
}
.dropdown:hover .dropdown_list {
display: block;
}
.dropdown_list a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown_list a:hover {
background-color: #f1f1f1
}
</style>
</head>
<body>
<div class="dropdown">
<button class="dropdown_button">Courses <i class="fa fa-arrow-circle-o-down"></i></button>
<div class="dropdown_list">
<a href="#">HTML</a>
<a href="#">CSS</a>
<a href="#">JavaScript</a>
<a href="#">JQuery</a>
<a href="#">AJAX</a>
<a href="#">Bootstrap</a>
<a href="#">Angular JS</a>
</div>
</div>
</body>
</html>
Output:
