我在自定义按钮中有两种颜色,其中第一种由按钮类定义,第二种由该按钮内的跨度类定义,当按钮处于活动状态时如何更改这两种颜色?
CSS:
.buttonClass{
color:black;
}
.buttonClass:active{
color:white;
}
.spanClass{
color:grey;
}
.spanClass:active{ //working only when I click on span, but not for whole button
color:red;
}
HTML:
<button class="buttonClass">
<span class="spanClass">
black/white text
</span>
grey/red text
</button>