滑出浮动层的CSS大块导航菜单
不知道该如何形容这种菜单,好像在微软以及Dell的网站导航地图里见到过,每一个菜单分类就可以细分和重新布局,显得很大气,简约但给你很清新的感觉。最上一行的是菜单总导航,当我们把鼠标放上的时候,会显出该菜单的二级分类,你可以进行重新排版,甚至加入图片也可以,本菜单可以广泛应用到产品一类的网站。
答案:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>滑出层模式的纯CSS大块导航菜单</title>
</head>
<style type="text/css">
body {
background: #fff;
font-family: "Lucida Grande", Helvetica, Arial, sans-serif;
font-size: 12px;
}
#lists {padding:0; margin:25px 0 50px 15px; list-style:none; position:relative; height:25px; float:left; background:url(/jscss/demoimg/200906/line2.gif) no-repeat 100% 4px; width:600px; z-index:500;}
#lists li {display:inline; float:left;; height:25px; background:url(/jscss/demoimg/200906/line2.gif) no-repeat 0 4px;}
#lists li a.tl {display:block; width:150px; height:25px; text-decoration:none; line-height:20px; font-size:12px; font-weight:bold; text-indent:10px; font-weight:normal; color:#000; background:url(/jscss/demoimg/200906/white_arrow2.gif) no-repeat 130px 5px;}
#lists div {display:none;}
#lists li a:hover {text-decoration:underline; white-space:normal; background-position:130px 15px;}
#lists li:hover > a {text-decoration:underline; white-space:normal; background-position:130px 15px;}
#lists :hover div
{display:block; width:598px; background:#faebd7; position:absolute; left:0; top:25px; border:1px solid #888; padding-bottom:10px;}
#lists :hover div.pos2 {background:#f0f5ee;}
#lists .two:hover {position:relative;}
#lists .single:hover {position:relative;}
#lists .two:hover div.pos3 {background:#f5eef0; width:300px;}
#lists .single:hover div.pos4 {background:#ffefd5; width:150px;}
#lists :hover div dl {display:inline; padding:0; margin:0 10px 10px 10px; float:left; width:179px;}
#lists :hover div dl dt {width:179px; background:#888; text-indent:10px; margin:5px 0 10px 0; text-decoration:none; height:20px; line-height:20px;}
#lists .two:hover div {left:-150px;}
#lists .two:hover div dl {width:129px;}
#lists .two:hover div dl dt {width:129px;}
#lists .single:hover div dl {width:129px;}
#lists .single:hover div dl dt {width:129px;}
#lists :hover div dl dd {padding:0; margin:0;}
#lists :hover div dt a {text-decoration:none; cursor:default; font-weight:normal; color:#fff;}
#lists :hover div dd a {display:block; text-decoration:none; font-weight:normal; font-size:11px; color:#000; text-indent:10px; line-height:15px;}
#lists :hover div dd a:hover {text-decoration:underline;}
#lists .clear {clear:both;}
</style>
<body>
<ul id="lists">
<li><a href="#" class="tl">美国站导航<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<div class="pos1">
<dl>
<dt><a href="#">Group one</a></dt>
<dd><a href="#">Alabama</a></dd>
<dd><a href="#">Alaska</a></dd>
</dl>
<dl>
<dt><a href="#">Group two</a></dt>
<dd><a href="#">Delaware</a></dd>
<dd><a href="#">Florida</a></dd>
</dl>
<dl>
<dt><a href="#">Group three</a></dt>
<dd><a href="#">Louisiana</a></dd>
<dd><a href="#">Maine</a></dd>
</dl>
<br class="clear" />
<dl>
<dt><a href="#">Group four</a></dt>
<dd><a href="#">Nebraska</a></dd>
<dd><a href="#">Nevada</a></dd>
</dl>
<dl>
<dt><a href="#">Group five</a></dt>
<dd><a href="#">North Dakota</a></dd>
<dd><a href="#">Ohio</a></dd>
</dl>
<dl>
<dt><a href="#">Group six</a></dt>
<dd><a href="#">Tennessee</a></dd>
<dd><a href="#">Texas</a></dd>
</dl>
</div>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li><a href="#" class="tl">英国站导航<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<div class="pos2">
<dl>
<dt><a href="#">Group one</a></dt>
<dd><a href="#">Aberdeenshire</a></dd>
<dd><a href="#">Anglesey</a></dd>
</dl>
<dl>
<dt><a href="#">Group two</a></dt>
<dd><a href="#">Bedfordshire</a></dd>
<dd><a href="#">Berkshire</a></dd>
</dl>
<dl>
<dt><a href="#">Group three</a></dt>
<dd><a href="#">Cardiganshire</a></dd>
<dd><a href="#">Cheshire</a></dd>
</dl>
<br class="clear" />
<dl>
<dt><a href="#">Group four</a></dt>
<dd><a href="#">Devon</a></dd>
<dd><a href="#">Down</a></dd>
</dl>
<dl>
<dt><a href="#">Group five</a></dt>
<dd><a href="#">Fife</a></dd>
<dd><a href="#">Glamorgan</a></dd>
</dl>
<dl>
<dt><a href="#">Group six</a></dt>
<dd><a href="#">Kent</a></dd>
<dd><a href="#">Kinross</a></dd>
</dl>
<br class="clear" />
<dl>
<dt><a href="#">Group seven</a></dt>
<dd><a href="#">Merioneth</a></dd>
<dd><a href="#">Midlothian</a></dd>
</dl>
<dl>
<dt><a href="#">Group eight</a></dt>
<dd><a href="#">Northumberland</a></dd>
<dd><a href="#">Orkney</a></dd>
</dl>
<dl>
<dt><a href="#">Group nine</a></dt>
<dd><a href="#">Ross-shire</a></dd>
<dd><a href="#">Rutland</a></dd>
</dl>
<br class="clear" />
<dl>
<dt><a href="#">Group ten</a></dt>
<dd><a href="#">Suffolk</a></dd>
<dd><a href="#">Sus易做图</a></dd>
</dl>
<dl>
<dt><a href="#">Group eleven</a></dt>
<dd><a href="#">Wiltshire</a></dd>
<dd><a href="#">Yorkshire</a></dd>
</dl>
</div>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li class="single"><a href="#" class="tl single">国际站点链接<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<div class="pos4">
<dl>
<dt><a href="#">CSS Showcase</a></dt>
<dd><a href="#">源码俱乐部</a></dd>
<dd><a href="#">新浪</a></dd>
</dl>
<dl>
<dt><a href="#">CSS Navigation</a></dt>