I am making a dropdown menu on one of my menu item.
ie: | Home | About | Store | Contact |
I want to create a dropdown menu for say About page…but Whenever I try to add
<div id="snaznav"> <a href="#" id="home">Home</a>
<ul>
<li><a href="#" id="about">About</a>
<ul>
<li><a href="#">Submenu1</li>
<li><a href="#">Submenu2</li>
<li><a href="#">Submenu3</li>
</ul>
</li>
</ul></div>
Every next menu item gets disturbed as:
Home | About
Store |
Contact |
I dont know..where the problem is?
My CSS code is:
#snaznav {
float:left;
height:42px;
top:151px;
width:670px;
}
#snaznav a {
float:left;
height:41px;
display:block;
}
#home {
background:url(http://www.abc.com/home.gif) no-repeat transparent;
background-position:0 -2px!important;
width:77px;
}
#about {
background:url(http://www.abc.com/about.gif) no-repeat transparent;
background-position:-78px -2px!important;
width:104px;
}
#store {
background:url(http://www.abc.com/storegif) no-repeat transparent;
background-position:-307px -2px!important;
width:82px;
}
#contactus {
background:url(http://www.abc.com/contact.gif) no-repeat transparent;
background-position:-388px -2px!important;
width:131px;
}
If you need anything to know, just say me !!
Can you rewrite your HTML Code this way:
HTML:
So that the CSS you can apply this way:
CSS:
Fiddle:
http://jsfiddle.net/VmHXb/1/ (Vertical)
http://jsfiddle.net/VmHXb/3/ (Horizontal)