2013-09-25 98 views
0

我正在一個由其他人構建的WordPress網站上工作,目前我正在嘗試對頁腳進行樣式設置並遇到一些問題。它只會在我直接選擇html元素(footer [role = contentinfo] p {...})時起作用,因爲它不會讓我的樣式在標籤中選擇任何div, ,甚至這是不穩定的。CSS頁腳樣式

任何人都可以提供一些指導?這裏是頁腳代碼

<?php 
/** 
* The template for displaying the footer. 
* 
* Contains footer content and the closing of the 
* #main and #page div elements. 
* 
* @package WordPress 
* @subpackage Twenty_Twelve 
* @since Twenty Twelve 1.0 
*/ 
?> 
    </div><!-- #main .wrapper --> 
    <footer id="colophon" role="contentinfo"> 
     <div class="footer-links"> 
      <ul> 
       <li>About</li> 
       <li>About JoeStick</li> 
       <li>Our Products</li> 
       <li>FAQs</li> 
      </ul> 
     </div> 
     <div class="site-info"> 
      <p>YOU MUST BE OVER THE AGE OF 18 YEARS TO BUY AND OR USE ANY SOUTH BEACH SMOKE PRODUCT. Nicotine is a highly addictive 
      substance derived from the tobacco plant. Our products do not treat, diagnose, or cure any disease, physical ailment, or 
      condition. If you are allergic to nicotene or any combination or inhalents, if you are pregnant or breast-feeding, or if 
      you have a heart condition, diabetes, high blood pressure or asthma, consult your physician before using South Beach Smoke 
      nicotene products. Just like traditional tobacco cigarettes, South Beach Smoke Electronic Cegiarettes are not approved by 
      the American FDA.</p> 
     </div><!-- .site-info --> 
     <div class="footer-nav"> 
      <ol> 
       <li>Copyright &copy; 2013 SmokeSafely.com</li> 
       <li>Terms and Conditions</li> 
       <li>Warnings</li> 
       <li>Privacy Policy</li> 
       <li>Contact</li> 
      </ol> 
     </div> 
    </footer><!-- #colophon --> 
</div><!-- #page --> 

<?php wp_footer(); ?> 
</body> 
</html> 

,這裏是我試圖使用

/* Footer */ 
} 
footer[role="contentinfo"] { 
    background-color: #082448; 
    color: white; 
    border-top: 1px solid #ededed; 
    font-size: 12px; 
    line-height: 2; 
    margin-left: auto; 
    margin-right: auto; 
} 
footer[role="contentinfo"] a { 
    color: #686868; 
} 
footer[role="contentinfo"] a:hover { 
    color: #21759b; 
} 
footer[role="contentinfo"] ul { 
    width: 30%; 
    float: left; 
} 
footer[role="contentinfo"] p { 
    width: 65%; 
    height: 30%; 
    float: left; 
    font-size: 10px; 
} 
footer[role="contentinfo"] ol { 
    width: 100%; 
    height: 5%; 
    float: none; 
} 
footer[role="contentinfo"] ol li { 
    float: left; 
    display: inline; 
} 

目前我正在掙扎更主要的是在頁腳無法正確顯示背景色的CSS。再次,任何幫助非常感謝。

回答

0

與ID選擇頁腳標籤:

#colophon {background-color:red;} 

...或任何你想讓它更改爲。

有時候WordPress的覆蓋這些規則,所以我用(我知道,我相信這是可怕的做法,但它能夠完成任務。)

#colophon {background-color:red !important;} 

然後搶文檔的某些部分,你可以用child selector.

#colophon > div > ul > li {background-color:red;} 

我希望這有助於!