2017-08-01 66 views
0

我努力的目標:瞄準背景通過CSS

<div class="shapely-content dropcaps-content"> 
      <div id="paralaxdiv" class="paralaxclass"><section id="titleimageparalax" class="intense content-section parallax-scene parallax titleimageparalaxclass" data-anchor-target='#titleimageparalax' data-bottom-top='background-position: 0px 40px;' data--1000-top='background-position: 0px -80px;' data-height-adjustment="10px" data-speed="2" style="height:700px; margin-bottom: 0px; margin-top: 0px; margin-left: 0px; margin-right: 0px; background-image: url(http://humatics.flywheelsites.com/wp-content/uploads/2017/07/par_who_top-2-940x623.jpg); background-size: cover; background-position: 50% 50%; background-attachment: fixed; padding-top: 25px; padding-bottom:25px; padding-left: 0px; padding-right:0px; overflow: hidden;"><ul id='parallax-scene-1973025556' class='parallax-scene-1973025556 parallax-scene'> 

背景大小:蓋;並將其更改爲100%。我無法弄清楚如何通過WordPress自定義代碼來改變CSS。我將如何定位這段代碼?

謝謝!

回答

1

您可以使用!重要。

#paralaxdiv>section{ 
    background-size: 100% auto !important; 
} 
+0

我覺得OP想在DOM加載後改變背景。 – Difster

1

你必須使用JavaScript或jQuery(我更喜歡jQuery)。

你會這樣做,像jquery:$("#titleimageparalax").css("background-color", "yellow");例如。