JSFiddle - React, Tailwind, and code Playground
HTML
<nav>
<ul id="menu">
<li><a href="index.html" id="selected">Home</a></li>
<li>
<a href="why.html">About</a>
<ul class="hidden">
<li><a href="why.html">Why Do It</a></li>
<li><a href="future.html">Future Plans</a></li>
</ul>
</li>
<li>
<a href="#top">Archive</a>
<ul class="hidden">
<li><a href="#June">June 2015</a></li>
<li><a href="#July">July 2015</a></li>
</ul>
</li>
</ul>
</nav>
<h2>My Blog Post</h2>
<p>Some blog text...</p>
CSS
/* Strip the ul of padding and list styling */
nav ul {
list-style: none;
margin: 0;
padding: 0;
}
/* Create a horizontal list with spacing */
nav li {
display: inline-block;
float: left;
margin-right: 1px;
}
/* Style for menu links */
nav li a {
display: block;
min-width: 140px;
height: 50px;
text-align: center;
line-height: 50px;
color: #fff;
background: #000;
text-decoration: none;
}
/* Hover state for top level links */
nav li:hover a {
background: #888888;
}
/* Style for dropdown links */
nav li:hover ul a {
background: #f3f3f3;
color: #2f3036;
height: 40px;
line-height: 40px;
}
/* Hover state for dropdown links */
nav li:hover ul a:hover {
background: #888888;
color: #fff;
}
/* Hide dropdown links until they are needed */
nav li ul {
display: none;
}
/* Make dropdown links vertical */
nav li ul li {
display: block;
float: none;
}
/* Prevent text wrapping */
nav li ul li a {
width: auto;
min-width: 100px;
padding: 0 20px;
}
/* Display the dropdown on hover */
nav ul li a:hover + .hidden, .hidden:hover {
position: absolute;
display: block;
}
h2 {
clear:left;
}
}