


*/īackground: rgba(255,255,255,0) /* But! Let's make the background fully transparent where we can, we don't actually want to see it if we can help it. In this tutorial we will see simple Dropdowns Ui, Dropdowns Dividers with Icon, Dropdowns Icon, examples with Tailwind CSS. Ive been practicing CSS for a while ago and trying to implement a simple drop-down menu without using either bootstrap or jQuery. Make this as close to your page's background as possible (i.e. Also, you don’t have to add it to the last item in the dropdown, I just did it for the sake of this tutorial. * Bring the nav above everything else-uncomment if needed.īackground-color: #fff /* Adding a background makes the dropdown work properly in IE7+. * BE SURE TO INCLUDE THE CSS RESET FOUND IN THE DEMO PAGE'S CSS */
#Simple css dropdown menu series
This is where the magic happens–we use CSS to transform a series of nested s into a smooth, easy to use, neat and self-contained dropdown menu. Notice the dropdown s have no classes on them–this is because we use the cascade to style these, keeping our markup even cleaner. nav contains a series of s, and any that require a dropdown then contain another.

No verbose IDs/classes, no s, just rich, semantic code. Basically, it lists all the subsections within a section of a site when you hover your mouse cursor over it.Īs you can see here the markup is simply a series of nested s. What a dropdown menu provides is a hierarchical overview of the subsections contained within the menu item that spawned it. Also, they are incredibly simple to create, and here’s where I teach you how… The concept Something as common and simple as a series of dropdown menus under each meta menu item would improve the navigability and usability of the site massively. I was looking at the main menu of the site when inspiration struck. This is by no means unacceptable, but we like to go that extra step at Venturelab… This is great, and works perfectly, but in order to get to, say, the FAQs page from the home page, you’d first have to go to the about page, then on to the FAQs from there. This article has been ported from the now-defunct Venturelab Devblog, where I had originally authored it.Įach page features a sub-navigation area, which links to all the other pages within that section of the website. We have so much to say and such a lot of content that the navigation of the site needed to be even more dynamic and encompassing than normal. In redeveloping the Venturelab site we became increasingly aware that there was a lot of content that needed navigating extremely simply and fairly rapidly.
Use a- tag in your