2012-10-15 65 views
0

好不齊,我有一箇中心DIV作爲頁腳只需:<div id="bottom-footer">Powered by Coolname</div>和風格:呈現集中在PC瀏覽器,但在iPhone瀏覽

#bottom-footer { 
width: 100%; 
height: 20px; 
position: absolute; 
bottom: 1px; 
text-align: center; 
} 

這使得在PC瀏覽器中確定: enter image description here

但是當你試圖在iPhone上,它看起來像這樣:

enter image description here

顯然不是中心,我做錯了什麼?

回答

0

看起來像是包含body元素或div本身的邊距或填充。添加到您的樣式表來重置瀏覽器的自然行爲:

html { 
margin:0px; 
padding:0px; 
} 

body { 
margin:0px; 
padding:0px; 
} 

#bottom-footer { 
width: 100%; 
height: 20px; 
position: absolute; 
bottom: 1px; 
text-align: center; 
margin:0px; 
padding:0px; 
} 
0

刪除width:100%

#bottom-footer { 
height: 20px; 
position: absolute; 
bottom: 1px; 
text-align: center; 
} 
相關問題