2014-04-23 43 views
0

在個人電腦上,我爲背景設置的背景看起來很好 - 覆蓋空間並固定在它的位置,以使包裝具有「懸停」效果。但是,在平板電腦或移動電話上,如果包裝紙/內容流過頁面,則背景略有不同,並且已發生變化 - 未完全覆蓋並固定到視口。固定的CSS背景覆蓋

我該如何解決這個問題?

html { 
     background: url(../images/wall2.jpg) no-repeat center center fixed; 
     -webkit-background-size: cover; 
     -moz-background-size: cover; 
     -o-background-size: cover; 
     background-size: cover; 
     min-height:100%; 
     min-width:100%; 
    } 
    body { 
     margin:0px; 
     overflow-y:scroll; 
    } 
    #wrapper { 
     margin:75px auto; 
     width:960px; 
     background-image:url(../images/bg.png); 
     background-repeat:repeat; 
    } 
    #content { 
     color:#000; 
     margin-top:0px; 
     padding:50px; 
    } 

我已經嘗試添加溢出:隱藏的包裝和內容,但並不能幫助。

這裏是一個的jsfiddle:

http://jsfiddle.net/3C5jX/

+0

把小提琴的,我們會幫助 –

+0

如何笨拙 - http://jsfiddle.net/3C5jX/ 謝謝 – Corey

+0

媒體查詢u需要爲我猜 –

回答

0

嘗試的高度和寬度設定爲110%,也嘗試添加背景作爲固定html元素,而不是一個CSS背景。