2013-09-27 34 views
0

任何人都有任何想法爲什麼title_services類的款式全部適用並且在title_services2類中僅適用line-height, font-weight; letter-spacing?當我在Chrome中使用Tool for Developers並選擇h4.title_services時,它列出了所有樣式,但是當我選擇h4.title_services2時,它僅顯示這三種樣式。下面是CSS(h4h4.title_services正常工作,h4.title_services2沒有)不是所有款式都適用

h4 { 
    font-size:28px; 
    line-height:2em; 
    color:#fff; 
    font-weight:normal; 
    letter-spacing:-1px; 
} 

h4.title_services { 
     font-size:28px; 
     margin-top:15px; 
     margin-bottom:15px; 
     text-align:center; 
     line-height:1em; 
     color:#fff; 
     font-weight:normal; 
     letter-spacing:-1px; 
} 

h4.title_services2 { 
        font-size:28px;  
        margin-top:25px; 
        margin-bottom:15px; 
        text-align:center; 
     line-height:1em;  
     color:blue;/*#fff;*/ 
     font-weight:normal; 
     letter-spacing:-1px; 
} 

HTML如下:

<article class="grid_3"> 
    <div class="indent-left"> 
    <img style="display: block; margin: 0 auto;" src="../images/services_kid.png" /> 
     <h4 class="title_services">First headline</h4> 
    <div id="button2"><a class="button2" href="#">BUTTON</a></div> 
    </div> 
</article> 
<article class="grid_3"> 
    <div class="indent-left"> 
    <img style="display: block; margin: 0 auto;" src="../images/services_kid2.png" /> 
     <h4 class="title_services2">Second headline</h4> 
    <div id="button2"><a class="button2" href="#">CENÍK</a></div> 
    </div> 
</article> 
+1

你有什麼不工作截圖或的jsfiddle。這並不完全清楚...... – LinkinTED

+0

你有'button2'作爲ID和類。首要問題。但我懷疑這會解決你的問題。您的主題問題未顯示在我的計算機上。你嘗試過各種瀏覽器嗎? – Andy

回答

1

這似乎是工作得很好。

ps .:我改變了顏色。 :P

http://jsfiddle.net/vinicius5581/edKSM/

h4 { 
    font-size:28px; 
    line-height:2em; 
    color:orange; 
    font-weight:normal; 
    letter-spacing:-1px; 
} 

h4.title_services { 
     font-size:28px; 
     margin-top:15px; 
     margin-bottom:15px; 
     text-align:center; 
     line-height:1em; 
     color:brown; 
     font-weight:normal; 
     letter-spacing:-1px; 
} 

h4.title_services2 { 
     font-size:28px; 
     margin-top:25px; 
     margin-bottom:15px; 
     text-align:center; 
     line-height:1em; 
     color:red;/*#fff;*/ 
     font-weight:normal; 
     letter-spacing:-1px; 
} 
+0

好吧,這很奇怪,我試圖單獨使用代碼,因爲你做得很好,工作也很好。所以在其他一些css類中必須有一個問題阻止它的工作。我會更深入地看一看。順便說一句。關於button2的ID和Class,這是有意的,因爲我只是因爲定位才需要使用div。但是,謝謝你,如果我知道了,我會讓你知道的。 –

相關問題