Cufon 鼠标悬停
我有一些像这样的 HTML:
<div class="button2" onclick="">
<div class="button_text">LOCATE STORES</div>
<div class="button_arrow"></div>
</div>
我将此代码用于 Cufon:
Cufon.replace('div.button2', { fontFamily: 'Bliss2H', hover: true, fontSize: '12px' });
我的 CSS:
div.button2 {
color: #d79645;
}
div.button2:hover {
color: white!important;
}
Cufon 有效,但是鼠标悬停时文本颜色不会改变。
I have some HTML like this:
<div class="button2" onclick="">
<div class="button_text">LOCATE STORES</div>
<div class="button_arrow"></div>
</div>
I use this code for Cufon:
Cufon.replace('div.button2', { fontFamily: 'Bliss2H', hover: true, fontSize: '12px' });
My CSS:
div.button2 {
color: #d79645;
}
div.button2:hover {
color: white!important;
}
Cufon works, however the text color does not change on mouse-over.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
出于性能原因,默认情况下不启用 :hover,这意味着您必须为需要它的元素单独启用它。您可以通过以下方式执行此操作:
https://github.com/sorccu/cufon/wiki/styling
For performance reasons :hover is not enabled by default, which means that you’ll have to enable it separately for elements that need it. You can do this with:
https://github.com/sorccu/cufon/wiki/styling
你的按钮是链接吗?这是我在此页面上进行的CSS: http://ianmartinphotography.com/test-site /
我的 cufon 按钮位于底部。
Your buttons are links? This is the CSS for what I've got going on this page: http://ianmartinphotography.com/test-site/
My cufon buttons are at bottom.
你试过用#FFFFFF代替白色吗?
你不能简单地拥有:
div.button2:hover {color: #FFFFFF;}
并且没有!重要吗?
Have you tried #FFFFFF instead of white?
Couldn't you simply have:
div.button2:hover {color: #FFFFFF;}
And not have !important?