2016-01-21 62 views
0

我正在創建一個視差滾動頁面。
一切正常,直到我打開智能手機上的頁面。響應式視差滾動更改媒體查詢背景

我有媒體查詢來改變佈局。
這裏是設置:

<div class="full_width_parallax"> 
    <div class="wrap_1280"> 
     <h1 class="intro-tagline"> 
      Content here 
     </h1> 
     </div> 
</div> 

的CSS(桌面版):

.full_width_parallax{ 
background:url(images/parallax-background/option-1.jpg) no-repeat center center fixed; 
-webkit-background-size: cover; 
-moz-background-size: cover; 
-o-background-size: cover; 
background-size: cover; 
} 

.wrap_1280{ 
padding: 0 3% 0 3%; 
background: #FFF; 
opacity: 0.6; 
margin: 0 70% 0 3%; 
} 

的CSS(移動版本max-width:480px

.full_width_parallax{ 
background:url(images/parallax-background/option-2.jpg) no-repeat center center fixed; 
} 
.wrap_1280{ 
margin: 0 3% 0 3%; 
} 

所以對於唯一的變化手機版是背景圖片和邊距。 如果我檢查鉻(桌面)的移動版本和運行控制檯它給了我:

enter image description here

因此,它應該工作,但沒有。
有什麼想法?

回答

0

好的。我現在是最笨的屁股......

移動版的樣式表位於一個文件夾中。
在CSS背景圖像鏈接並沒有正確的路徑...

background:url(images/parallax-background/option-2.jpg) no-repeat center center fixed;

本來應該是:
background:url(../images/parallax-background/option-3.jpg) no-repeat center center fixed;