The following will give you a drop-down menu with hover support and some basic formatting. It should be fairly self-explanatory for you to work through, but leave a comment if anything is unclear.
The basic idea is that the dropdown-content class hides the div containing the menu entries until you hover over the button representing the menu root (.dropbtn:hover).
Plain HTML and CSS.
.menuContainer {
padding-left: 5px;
padding-top: 5px;
background-color: #cccccc;
}
/* Dropdown Button */
.dropbtn {
background-color: #808080;
color: #000;
border: solid black 1px;
cursor: pointer;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
font-size: 0.75em;
height: 2em;
width: 110px;
margin: 0px;
margin-bottom: 5px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.dropbtn:hover {
background-color:#00F;
color: #FFF;
font-weight: bold;
}
/* The container <div> - needed to position the dropdown content */
.dropdown {
position: relative;
display: inline-block;
z-index: 100;
}
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
display: none;
position: absolute;
background-color: #e6e6e6;
/*min-width: 100px;*/
width: 120%;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
text-align: left;
}
/* Links inside the dropdown */
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
/* Change color of dropdown links on hover */
.dropdown-content a:hover {
background-color: #CCC;
}
/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
display: block;
}
/* Change the background color of the dropdown button when the dropdown content is shown */
.dropdown:hover .dropbtn {
background-color: #00F;
color: #FFF;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link rel=stylesheet href="menuex.css" type="text/css"/>
</head>
<body>
<div class="menuContainer">
<div class="dropdown">
<button class="dropbtn">List 1</button>
<div class="dropdown-content">
<a href="a1.html">Option 1</a>
<a href="a2.html">Option 2</a>
<a href="a3.html">Option 3</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">List 2</button>
<div class="dropdown-content">
<a href="b1.html">Option 1</a>
<a href="b2.html">Option 2</a>
<a href="b3.html">Option 3</a>
</div>
</div>
</div>
</body>
</html>