這是感覺簡單的問題,但我努力獲得確切的輸出。我需要在頁腳中對齊3格的div。我在谷歌嘗試了很多,之前也工作過。但在頁腳固定的位置它不能正常工作。 如何對齊3個div並排在頁腳Div(固定位置)
在該圖像中,用於頁腳,紅色左側,綠色右側和中心的白色容器div。
這裏是我的CSS:
div .footer-container
{
height:53px;
width:100%;
position:fixed;
}
div .footer-container div .footer-left
{
background-color:#f00;
float:left;
width:33%;
height:31px;
}
div .footer-container div .footer-right
{
background-color:#0f0;
float:right;
width:33%;
height:31px;
}
div .footer-container div .footer-center
{
background-color:#f0f;
margin:0 auto;
height:31px;
width:33%;
}
這裏是HTML:
<div data-role = "footer" class="footer-container">
<div>
<div class="footer-left"></div>
<div class="footer-right"></div>
<div class="footer-center"></div>
</div>
</div>
我究竟做錯了什麼?請解釋一下。
你能後的標記?我看到它就像你的形象:http://jsfiddle.net/ap6EG/ –
是啊這就是爲什麼我要求幫助:-( – ssss05
只是放置.footer中心作爲第一個孩子;) –