【发布时间】:2017-02-24 23:04:31
【问题描述】:
我试图在悬停时更改well 内的h2 的字体颜色。背景颜色正确更改,但同时我还需要 h2 的字体颜色更改为白色。
如何做到这一点?
.well.sb:hover {
color: #FFF;
background-color: blue;
}
.well.sb {
background-color:green;
width:400px;
height:200px;
}
h2 {
color:yellow;
}
.flag {
background-color:#000;
color:red;
}
<div class="well sb">
<h2>This text should change color and become white on hover-over</h2>
<div class="flag">FLAG</div>
</div>
【问题讨论】: