[英]CSS - Help styling my menu items
码
<div class="navheader">
<ul class="navuseraccess">
<li><a runat="server" id="mnuAccount" href="AccountSettings.aspx">My Account</a></li>
</ul>
</div>
的CSS
div.navheader {
overflow: hidden;
position: absolute;
right: 0;
bottom: 0;
width: 775px;
height: 43px;
margin: 0;
padding: 0 20px 0px 20px;
list-style-type: none;
background-image: url(../images/header_bkg_navmain.jpg);
background-repeat: no-repeat;
}
ul.navuseraccess {
float: right;
height: 43px;
margin: 0;
padding: 0;
list-style-type: none;
}
.navuseraccess li {
float: left;
margin: 0;
padding: 0;
color: #fff;
font-size: 13px;
line-height: 43px;
}
.navuseraccess li a {
display: block;
height: 43px;
color: #fff;
margin: 0;
padding: 0 8px;
text-decoration: none;
line-height: 43px;
}
我想要做的是添加一个新的listitem-anchor,但希望它显示在现有的listitem-anchor之下,而不是在其旁边。 因此,我猜测我将不得不将现有的移动一点,然后在其下方添加一个新的。
您不需要float
元素。 它们已经被收缩包装,因为它们包含在position: absolute
元素中。 只要您删除height
和width
属性,该元素就会根据需要增长,并固定在页面的右下方。
实际观看: http : //jsfiddle.net/MJrfX/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.