我有一个内联列表,我试图去“填充”它的div的整个宽度。css内联列表边距
如果我在列表中使用了一个margin-right,最后一个元素将不会到达div的末尾(因为它有正确的边距),或者右边距会强制它在下一行超过div的宽度。
这里是我所描述的例子。
我的html:
<div id="footerstick" style="background:url(site_files/bg_shears.png) repeat-x; ">
<div id="footer_wrap">
<div id="footer_top_shelf">
<ul>
<li>Contact Us</li>
<li>FAQ</li>
<li>About Us</li>
<li>Distribution</li>
</ul>
</div>
</div>
</div>
我的CSS:
#footerstick {
position: relative;
margin-top: -230px; /* negative value of footer height */
height: 230px;
clear:both;
}
#footer_wrap {width:980px; margin:auto;}
#footer_top_shelf {height:70px; overflow:hidden; }
#footer_top_shelf ul li {display:inline; list-style:none; color:#c7c7c7; font-size:30px; margin-right:85px; line-height:75px; text-transform:uppercase; font-family:myriad pro; }
你的问题是什么? – Madbreaks 2012-03-12 04:02:01
如何让第一个列表元素完全位于左侧,最后一个元素位于右侧。我不认为我想要使用第n个孩子选择器,因为它不与旧版的broswers兼容吗? – Sackling 2012-03-12 04:23:56