我不能在div中居中ul。在div中居中ul(已經居中在頁面上)
HTML:
<div id="footer"> <span class="copy">Copyrights 2014</span>
<ul class="hor_list" id="footer_menu">
<li><a href="">HOME</a>
</li>
<li><a href="">SHOPS</a>
</li>
<li><a href="">CONTACT US</a>
</li>
</ul> <a href="" class="footer_link">www</a>
</div>
我需要footer_menu
是在中心。 #footer
在頁面居中,我需要footer_menu在頁腳中居中。
CSS:
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
#footer {
text-transform: uppercase;
}
#footer {
color: #373737;
font-size: 10px;
line-height: 24px;
height: 24px;
width: 1000px;
margin: 0 auto;
}
.hor_list {
display: inline-block;
}
.hor_list li {
display: inline;
}
ol, ul {
list-style: none;
}
這裏是工作的jsfiddle:http://jsfiddle.net/WXYx8/
我是想這樣的事情,不工作:
#footer_menu {
display: inline-block;
width: 300px;
margin: 0 auto;
}
編輯:
我不需要「span
」和「a.footer_link
」w ithin footer被集中(而不是那些應該是非常左和非常正確的)。
我不需要其他工作人員進行cenetered,只是微升。我需要跨越左右,一個是正確的。 – renathy