主题:[讨论]请教css问题
css的代码如下:
@charset "gb2312";
#nav { padding:0; margin:0; list-style:none; height:33px; position:relative; z-index:500;
font-family:Verdana,Tahoma,Arial;}
#nav li.top {display:block; float:left; height:33px;}
#nav li a.top_link {display:block; float:left; height:33px; line-height:33px; color:#ddd;
text-decoration:none; font-size:11px; font-weight:bold; padding:0 0 0 12px;
cursor:pointer;}
#nav li a.top_link span {float:left; display:block; padding:0 24px 0 12px; height:33px; }
#nav li a.top_link span.down {float:left; display:block; padding:0 24px 0 12px;
height:33px; }
#nav li:hover a.top_link {color:#fff; }
/* Default list styling */
#nav li:hover {position:relative; z-index:200;}
#nav li:hover ul.sub
{left:1px; top:23px; background: #32ACFE; padding:3px; border:1px solid #325094; white-
space:nowrap; width:90px; height:auto; z-index:300;}
#nav li:hover ul.sub li
{display:block; height:20px; position:relative; float:left; width:90px; font-
weight:normal;}
#nav li:hover ul.sub li a
{display:block; font-size:11px; height:18px; width:88px; line-height:18px; text-indent:5px;
color:#000; text-decoration:none;border:1px solid #32ACFE;}
#nav li ul.sub li a.fly
{background:#32ACFE url(arrow.gif) 80px 6px no-repeat;}
#nav li:hover ul.sub li a:hover
{background:#089AFC; color:#fff; border-color:#fff;}
#nav li:hover ul.sub li a.fly:hover
{background:#089AFC url(arrow_over.gif) 80px 6px no-repeat; color:#fff;}
#nav li:hover li:hover ul,
#nav li:hover li:hover li:hover ul,
#nav li:hover li:hover li:hover li:hover ul,
#nav li:hover li:hover li:hover li:hover li:hover ul
{left:90px; top:-4px; background: #32ACFE; padding:3px; border:1px solid #325094; white-
space:nowrap; width:90px; z-index:400; height:auto;}
#nav ul,
#nav li:hover ul ul,
#nav li:hover li:hover ul ul,
#nav li:hover li:hover li:hover ul ul,
#nav li:hover li:hover li:hover li:hover ul ul
{position:absolute; left:-9999px; top:-9999px; width:0; height:0; margin:0; padding:0;
list-style:none;}
#nav li:hover li:hover a.fly,
#nav li:hover li:hover li:hover a.fly,
#nav li:hover li:hover li:hover li:hover a.fly,
#nav li:hover li:hover li:hover li:hover li:hover a.fly
{background:#089AFC url(arrow_over.gif) 80px 6px no-repeat; color:#fff; border-color:#fff;}
#nav li:hover li:hover li a.fly,
#nav li:hover li:hover li:hover li a.fly,
#nav li:hover li:hover li:hover li:hover li a.fly
{background:#32ACFE url(arrow.gif) 80px 6px no-repeat; color:#000; border-color:#32ACFE;}
菜单代码:
<ul id="nav">
<li class="top"><a href="index.asp" class="top_link"><span>|菜单一
</span></a></li>
<li class="top"><a href="#" class="top_link">
<span class="down">|菜单二</span></a>
<ul class="sub">
<li><a href="#">- 菜单二1</a></li>
<li><a href="#">- 菜单二2</a></li>
<li><a href="#">- 菜单二3</a></li>
<li><a href="#">- 菜单二4</a></li>
</ul>
</li>
<li class="top"><a href="#" id="services" class="top_link">
<span class="down">|菜单三</span></a>
<ul class="sub">
<li><a href="#">- 菜单三1</a></li>
</ul>
</li>
<li class="top"><a href="#" id="contacts" class="top_link">
<span class="down">|菜单四</span></a>
</li>
<li class="top"><a href="#" id="say" class="top_link">
<span class="down">|菜单五</span></a>
<ul class="sub">
<li><a href="#">- 菜单五1</a></li>
</ul>
</li>
</ul>
css如何调小菜单顶行每个栏目的宽度,(如 菜单一、菜单二、菜单三、菜单四、菜单五之间每个的宽度
)
@charset "gb2312";
#nav { padding:0; margin:0; list-style:none; height:33px; position:relative; z-index:500;
font-family:Verdana,Tahoma,Arial;}
#nav li.top {display:block; float:left; height:33px;}
#nav li a.top_link {display:block; float:left; height:33px; line-height:33px; color:#ddd;
text-decoration:none; font-size:11px; font-weight:bold; padding:0 0 0 12px;
cursor:pointer;}
#nav li a.top_link span {float:left; display:block; padding:0 24px 0 12px; height:33px; }
#nav li a.top_link span.down {float:left; display:block; padding:0 24px 0 12px;
height:33px; }
#nav li:hover a.top_link {color:#fff; }
/* Default list styling */
#nav li:hover {position:relative; z-index:200;}
#nav li:hover ul.sub
{left:1px; top:23px; background: #32ACFE; padding:3px; border:1px solid #325094; white-
space:nowrap; width:90px; height:auto; z-index:300;}
#nav li:hover ul.sub li
{display:block; height:20px; position:relative; float:left; width:90px; font-
weight:normal;}
#nav li:hover ul.sub li a
{display:block; font-size:11px; height:18px; width:88px; line-height:18px; text-indent:5px;
color:#000; text-decoration:none;border:1px solid #32ACFE;}
#nav li ul.sub li a.fly
{background:#32ACFE url(arrow.gif) 80px 6px no-repeat;}
#nav li:hover ul.sub li a:hover
{background:#089AFC; color:#fff; border-color:#fff;}
#nav li:hover ul.sub li a.fly:hover
{background:#089AFC url(arrow_over.gif) 80px 6px no-repeat; color:#fff;}
#nav li:hover li:hover ul,
#nav li:hover li:hover li:hover ul,
#nav li:hover li:hover li:hover li:hover ul,
#nav li:hover li:hover li:hover li:hover li:hover ul
{left:90px; top:-4px; background: #32ACFE; padding:3px; border:1px solid #325094; white-
space:nowrap; width:90px; z-index:400; height:auto;}
#nav ul,
#nav li:hover ul ul,
#nav li:hover li:hover ul ul,
#nav li:hover li:hover li:hover ul ul,
#nav li:hover li:hover li:hover li:hover ul ul
{position:absolute; left:-9999px; top:-9999px; width:0; height:0; margin:0; padding:0;
list-style:none;}
#nav li:hover li:hover a.fly,
#nav li:hover li:hover li:hover a.fly,
#nav li:hover li:hover li:hover li:hover a.fly,
#nav li:hover li:hover li:hover li:hover li:hover a.fly
{background:#089AFC url(arrow_over.gif) 80px 6px no-repeat; color:#fff; border-color:#fff;}
#nav li:hover li:hover li a.fly,
#nav li:hover li:hover li:hover li a.fly,
#nav li:hover li:hover li:hover li:hover li a.fly
{background:#32ACFE url(arrow.gif) 80px 6px no-repeat; color:#000; border-color:#32ACFE;}
菜单代码:
<ul id="nav">
<li class="top"><a href="index.asp" class="top_link"><span>|菜单一
</span></a></li>
<li class="top"><a href="#" class="top_link">
<span class="down">|菜单二</span></a>
<ul class="sub">
<li><a href="#">- 菜单二1</a></li>
<li><a href="#">- 菜单二2</a></li>
<li><a href="#">- 菜单二3</a></li>
<li><a href="#">- 菜单二4</a></li>
</ul>
</li>
<li class="top"><a href="#" id="services" class="top_link">
<span class="down">|菜单三</span></a>
<ul class="sub">
<li><a href="#">- 菜单三1</a></li>
</ul>
</li>
<li class="top"><a href="#" id="contacts" class="top_link">
<span class="down">|菜单四</span></a>
</li>
<li class="top"><a href="#" id="say" class="top_link">
<span class="down">|菜单五</span></a>
<ul class="sub">
<li><a href="#">- 菜单五1</a></li>
</ul>
</li>
</ul>
css如何调小菜单顶行每个栏目的宽度,(如 菜单一、菜单二、菜单三、菜单四、菜单五之间每个的宽度
)