2017-04-27 83 views
0

當我的屏幕寬度爲682PX時,我的圖像寬度未覆蓋在屏幕上並開始消失。它顯然沒有反應,我無能爲力。我的視差圖像無法響應手機/引導程序

我還爲我的部分parrallax添加了一類'img-responsive'。這也沒有奏效。

<section class="module parallax parallax-1" class="img-responsive"> 
    <div class="container"> 
    <h1>Services</h1> 
    </div> 
</section> 

<section class="module content"> 
    <div class="container"> 
    <h2>Lorem Ipsum Dolor</h2> 
     <p></p> 
    </div> 
</section> 
</div> 

CSS:

section.module:last-child { 
    margin-bottom: 0; 
} 
section.module h2 { 
    margin-bottom: 40px; 
    font-family: "Roboto Slab", serif; 
    font-size: 30px; 
} 
section.module p { 
    margin-bottom: 40px; 
    font-size: 16px; 
    font-weight: 300; 
} 
section.module p:last-child { 
    margin-bottom: 0; 
} 
section.module.content { 
    padding: 40px 0; 
    height: 600px; 
} 
section.module.parallax { 
    height: 600px; 
    background-position: 50% 50%; 
    background-repeat: no-repeat; 
    background-attachment: fixed; 
    background-size: cover !important; 
    margin-top: -30px; 
} 
section.module.parallax h1 { 
    color: rgba(255, 255, 255, 0.8); 
    font-size: 48px; 
    line-height: 600px; 
    font-weight: 700; 
    text-align: center; 
    text-transform: uppercase; 
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.2); 
} 

section.module.parallax-1 { 
    background-image: url("../img/rolling.jpg"); 


} 
+0

我不知道,這是你在找什麼? https://codepen.io/k185/pen/MmJXOv – k185

+0

是的,確切!圖像完全響應。你從我的代碼中改變了什麼?感謝您的幫助。 – Benjamints

+0

創建一個答案,我會將其標記爲正確的。 – Benjamints

回答

0

檢查section.module.parallax-1部分,我已經添加背景功能此類。也去掉了section.module.parallax類,因爲它有與結果衝突,提出問題

section.module:last-child { 
 
    margin-bottom: 0; 
 
} 
 
section.module h2 { 
 
    margin-bottom: 40px; 
 
    font-family: "Roboto Slab", serif; 
 
    font-size: 30px; 
 
} 
 
section.module p { 
 
    margin-bottom: 40px; 
 
    font-size: 16px; 
 
    font-weight: 300; 
 
} 
 
section.module p:last-child { 
 
    margin-bottom: 0; 
 
} 
 
section.module.content { 
 
    padding: 40px 0; 
 
    height: 600px; 
 
} 
 

 
section.module.parallax h1 { 
 
    color: rgba(255, 255, 255, 0.8); 
 
    font-size: 48px; 
 
    line-height: 600px; 
 
    font-weight: 700; 
 
    text-align: center; 
 
    text-transform: uppercase; 
 
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.2); 
 
} 
 

 
section.module.parallax-1 { 
 
    background-image: url("https://image.ibb.co/dquSd5/rolling.jpg"); 
 
    background-repeat:no-repeat; 
 
background-size:contain; 
 
    background-size: 100%; 
 
top: 0; 
 

 

 
}
<section class="module parallax parallax-1 img-responsive"> 
 
    <div class="container"> 
 

 
    <h1>Services</h1> 
 
    </div> 
 
</section> 
 

 
<section class="module content"> 
 
    <div class="container"> 
 
    <h2>Lorem Ipsum Dolor</h2> 
 
     <p></p> 
 
    </div> 
 
</section> 
 
</div>

+0

出於某種原因,當我將它應用於我的代碼時,我的圖像仍然沒有響應。 – Benjamints

+0

這沒有意義。 – Benjamints

+0

你可以上傳你的圖像文件 – k185

相關問題