0

任何人都知道为什么课堂上的风格title_services适用于所有而 title_services2课堂上的风格只适用line-height, font-weight; letter-spacing?当我在 Chrome 中使用 Tool for Developers 并选择h4.title_services它时,它会列出所有样式,但当我选择h4.title_services2它时,它只显示这三种样式。下面是CSS(h4并且h4.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>
4

1 回答 1

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;
}
于 2013-09-27T10:57:39.447 回答