2014-10-17 68 views
0

我需要設置background-attachment: fixedthis page(俄羅斯文本,但你會看到所有的錯誤,如果在Android瀏覽器上打開它)的幾個背景,但它不會工作!這對我來說非常重要,我在尋找如何去做,但它只適用於一個bg,而不適合我。CSS:背景附件:固定不工作在Android

回答

0

根據Chrome的開發者工具,您smartmobile.css你需要在主容器div的一些變化:

.ct-general { 
    background-attachment: scroll; /* Change this to fixed, line 1 */ 
} 

.ct-catalog { 
    background-attachment: scroll; /* change to fixed, remove other declarations, line 4 */ 
} 

.ct-schema { 
    background-attachment: scroll; /* change to fixed, line 9 */ 
} 

.ct-sravn { 
    background: url('../images/bg_wins.png') !important; 
    background-size: auto !important; 
    background-attachment: scroll !important; /*change to fixed, line 12 */ 
} 

.ct-clients { 
    background: url('../images/clients_bg.png') !important; 
    background-size: auto !important;   /* change to cover to fill the space */ 
    background-attachment: scroll !important; /* change to fixed, 18 */ 
} 

這將符合現在移動你的桌面風格。

+0

但'背景附件:固定'根本不顯示背景 – 2014-10-18 00:13:17

+0

我不確定你的意思。我正在測試這種方法,並且當我查看頁面時,它正確地顯示在移動設備(Android專用)上。什麼不正確? – Brian 2014-10-18 00:25:57

+0

我把'scroll'改成'fixed',看看。我在HTC One M8上檢查它(android 4.4.2),這是行不通的。附:檢查水平方向。 – 2014-10-18 00:31:07