2013-04-05 71 views
0

當我在我的平板電腦上訪問我的網站時,背景在頁腳停止顯示之後?當我縮小窗口大小時,它在我的桌面上的行爲不像這樣。背景圖片沒有覆蓋在平板電腦上

這是網站:http://www3.carleton.ca/clubs/sissa/html5/video.html

CSS:

body{ 
    width: 100%; /*always specify this when using flexBox*/ 
    height:100%; 
    display: -webkit-box; 
    display: -moz-box; 
    display: box; 
    text-align:center; 
    -webkit-box-pack:center; /*way of centering the website*/ 
    -moz-box-pack:center; 
    box-pack:center; 
    background:black; 
    background:url('images/bg/bg14.jpg') no-repeat center center fixed; 
    -webkit-background-size: cover !important; 
    -moz-background-size: cover !important; 
    background-size: cover !important; 
    font-family: Arial, Helvetica, sans-serif; 
    font-size: 13px; 
} 

這是它看起來像我的Nexus 7: enter image description here

當我使用不同的用戶代理瀏覽器它涵蓋了整個背景: enter image description here

HTML:

<!--Site Main Body--> 
<div id="wrapper"> 
    <section id="body_div"> 

    </section> 

    <footer id="footer"> 
     &copy; Copyright by SimKessy 
    </footer> 

</div> 
</body> 
</html> 

回答

0

不知道這是否會幫助和我沒有測試它的可能性,但你可以嘗試添加背景屬性到html元素,而不是的body元素。

我刪除了!important,但如果您需要它,可以將其添加回去。

html { 
    background:black; 
    background:url('images/bg/bg14.jpg') no-repeat center center fixed; 
    -webkit-background-size: cover; 
    -moz-background-size: cover; 
    background-size: cover; 
} 
+0

沒有工作。在頁腳下我仍然是白色的。 – Batman 2013-04-06 02:20:34

1

你可以嘗試

body { 
    background-size: 100% 100%; 
} 
+0

我試過這個,但它沒有效果 – Batman 2013-04-06 02:20:14