我想在下面更改背景颜色和文本颜色div
:
HTML
<div class="readmore">
<a href="#">readmore</a>
</div>
CSS
.readmore{
width: 200px;
text-align: right;
background-color: #FFCC66;
color: #336699;
}
.readmore:hover{
background-color: #336699;
color: #FFCC66;
transition: all 1s;
}
当我聚焦.readmore
时,背景颜色会发生变化,但“readmore”文本不会改变颜色......这是为什么呢?