【发布时间】:2016-01-24 14:18:28
【问题描述】:
我有一个按钮:
.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;
}
但它不起作用。
【问题讨论】:
标签: css