我做的一个导航下拉菜单,可是好象定位不够好
我用CSS做的导航菜单,下面是我的样式和代码
[CSS]
.m_layout
{
width:612px;
height:22px;
background:#666666;
text-align:center;
list-style:none;
}
.f_layout
{
float:left;
width:153px;
height:22px;
color:#CCCCCC;
text-align:center;
}
.ff_layout
{
display:none;
width:153px;
height:218px;
background:#CCCCCC;
text-align:center;
}
.f_layout:hover .ff_layout
{
display:block;
}
[CSS]
这里是HTML代码:
<!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>无标题文档</title>
<link href="lay.css" rel="stylesheet" type="text/css" />
</head>
<body>
<ul class="m_layout">
<li class="f_layout">HOME
<ul class="ff_layout">Please Press The HOME Button</ul>
</li>
<li class="f_layout">NAME
<ul class="ff_layout">Please Press The NAME Button</ul>
</li>
<li class="f_layout">ABOUT
<ul class="ff_layout">Please Press The ABOUT Button</ul>
</li>
<li class="f_layout">EPAGE
<ul class="ff_layout">Please Press The EPAGE Button</ul>
</li>
</ul>
</body>
</html>
出现的效果很奇怪,没有办法让二级菜单与一级菜单垂直对齐,总是会向右推进一些,到底CSS代码哪里出了问题?谢谢~~~