user3179854
user3179854

Reputation:

how to display sub menu on horizontal css menu

I have this CSS Menu:

http://jsfiddle.net/73GrF/

but i cannot work out what css code i need for the hover:

#nav li a:hover

Upvotes: 0

Views: 59

Answers (2)

Chris Lear
Chris Lear

Reputation: 6742

http://jsfiddle.net/73GrF/5/ is what I came up with while McMastermind was at work.

The main thing I've done is taken the margins off, floated the menu headers, and made the submenus appear on hover

#nav>li {
    float:left

}
#nav li:hover ul {
    position:absolute;
    display:block;
}

#nav li a {
    margin:0;
}

Upvotes: 0

kingkode
kingkode

Reputation: 2219

trigger the hover on your li element. Don't forget to set your submenu position to absolute

#nav li:hover ul {
     display:block;   
}

http://jsfiddle.net/73GrF/4/ (edited fiddle with crude dropdown styling. ill leave the dressing up to you.)

Upvotes: 1

Related Questions