我有一個按鈕:風格:之前在懸停
.button{
background-color:red;
color:#fff;
width:70px;
}
.button:before{
min-width:0px;
content: attr(data-number);
}
HTML:
<div class="button" data-number="5"><a href="javascript:;">button</a></div>
我的問題是,我想要的內容數量是黑色的,當用戶放鼠標懸停button
文本。 我嘗試:
.button:hover .button:before{
color:#000;
}
但它不工作。
謝謝各位朋友! –