我用css做了一個下拉導航欄。 但是,希望菜單項的字體大小不同,然後子菜單項..這也將是很好,如果我可以改變子菜單的外觀,改變框的大小等 我真的迷路了,我所能做的我同時改變了這兩件事。下拉導航欄
任何想法我可以做的CSS? :)
<div class="grid_7"id="navigation">
<ul>
<li>
<a href=""class="parent">Menu Item 1</a>
<ul>
<li><a href="#">sub menu item 1</a></li>
<li><a href="#">sub menu item 2</a></li>
<li><a href="#">sub menu item 3</a></li>
<li><a href="#">sub menu item 4</a></li>
</ul>
</li>
</ul>
<ul>
<li><a href="">Menu Item 1</a>
<ul>
<li><a href="#">sub menu item 1</a></li>
<li><a href="#">sub menu item 2</a></li>
<li><a href="#">sub menu item 3</a></li>
<li><a href="#">sub menu item 4</a></li>
</ul>
</li>
</ul>
<ul>
<li><a href="">Menu Item 1</a>
<ul>
<li><a href="#">sub menu item 1</a></li>
<li><a href="#">sub menu item 2</a></li>
<li><a href="#">sub menu item 3</a></li>
<li><a href="#">sub menu item 4</a></li>
</ul>
</li>
</ul>
CSS:
#navigation
{
height:75px;
}
#utility
{
height:75px;
}
ul
{
font-family: Arial, Verdana;
margin: 0;
padding: 0;
}
ul li
{
display: block;
position: relative;
float: left;
font-size:16px;
}
li ul { display: none; }
#navigation ul
{margin:0px; padding:0px;}
ul li a
{
display:block;
text-decoration: none;
color: white;
padding: 20px 30px 20px 15px;
position:relative;
margin: 0;
}
ul li a:hover
{
background: #355F9E;
}
li:hover ul
{
display: block;
position: absolute;
}
li:hover a
{
background: #355F9E;
}
li:hover li a:hover
{
background: #BCCDD8;
}
檢查鏈接 http://net.tutsplus.com/tutorials/html-css-techniques/how-to-create-a-drop-down -nav-menu-with-html5-css3-and-jquery/ http://net.tutsplus.com/tutorials/html-css-techniques/how-to-build-a-kick-butt-css3-mega -drop-down-menu/ – SRN