我在網站上有一張圖片幻燈片,我想要一定的跨度長度,同時也是居中。它的跨度爲9,但即使使用text-align:center屬性也無法使其居中。如何居中該跨度元素?
<div class="span9">
<section id="slider">
<div class="fullwidthbanner-container" style="text-align:center;">
<div class="fullwidthbanner" style="text-align:center;">
</div>
</div>
</section>
</div>
這裏的CSS:
#slider {
margin-top: 100px;
text-align: center;
}
.fullwidthbanner-container{
width: 100%;
position: relative;
max-height: 700px;
overflow: hidden;
text-align: center;
}
.sliderbanner-container{
width: 100%;
position: relative;
max-height: 600px;
overflow: hidden;
text-align: center;
}
.fullwidthbanner ul li,
.sliderbanner-container ul li {
list-style: none;
text-align: center;
}
這裏的的jsfiddle還有:http://jsfiddle.net/uu6dch71/5/
但是,它沒有真正顯示在預覽了。參考該網站是http://jmvanwyck.com
給居中'.span9'一個'width'和'height'和使用'餘量: 0 auto;'。 – PHPglue