任何人都知道为什么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>
答案 0 :(得分: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;
}