I have a stylish horizontal navigation bar with links set up like this:
<div class="blackbar">
<span class="blackbar-text"><a href="news.php">NEWS</a></span>
<span class="blackbar-text"><a href="foo.php">FOO</a></span>
<span class="blackbar-text"><a href="bar.php">BAR</a></span>
</div>
styled with the following CSS:
div.blackbar {
margin: 0px;
padding-left: 20px;
padding-right: 10px;
padding-top: 6px;
text-align: center;
vertical-align: middle;
background-color: #888;
}
.blackbar-text {
padding: 0px 12px;
font-size: 17px;
font-weight: 900;
text-shadow: 0 -1px 0 #000;
}
.blackbar-text a:link,.blackbar-text a:visited {
color:#e8e8e8;
}
Now, I want to create a dropdown effect that appears when hovering over one of these links. The dropdown should be positioned above the blackbar-div and under the link's text.
I know how to handle the JavaScript part for mouseover/out events with jQuery, but I need help with setting up the HTML and CSS structure to achieve this effect.
Check out this fiddle: https://jsfiddle.net/o4su1Lbd/
Here is an image to illustrate the desired effect: