我有一個內聯列表,我試圖去「填充」它的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