我想在此代码中将 h3 链接的颜色更改为红色:
<div class="news_headline">
<h3 class="breaking"><a href="#">title</a></h3>
</div>
我将 css 更改为:
a.breaking {
padding-right: 40px;
background: url('../images/icons/news_breaking.png') right center no-repeat;
color: red;
}
但是没用!!!它显示标题为蓝色!这是我更改的 CSS:
最佳答案
将 a.breaking
更改为 .breaking a
或将 breaking
类添加到 anchor 元素。
关于html - 这个CSS有什么问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9941727/