Jump to content

How are drop down menus created?


astralaaron
 Share

Recommended Posts

All you need is HTML, CSS and sometimes Javascript.Here's a basic example of a dropdown menu only using CSS:HTML:<a href="#" id="menu">Hover</a><ul><li>Menu item 1</li><li>Menu item 2</li><li>Menu item 3</li><li>Menu item 4</li></ul>CSS:a#menu + ul {display: none;}a#menu:hover + ul {display: block;}

Link to comment
Share on other sites

<html><head><link rel="stylesheet" style="text/css" href="drop.css"></head><body><a href="#" id="menu">Hover</a><ul><li>Menu item 1</li><li>Menu item 2</li><li>Menu item 3</li><li>Menu item 4</li></ul></body></html>and css file:a#menu + ul {display: none;}a#menu:hover + ul {display: block;}didnt work

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...