我在 anchor 中显示了 Twitter Bootstrap 提供的图标之一。当我将鼠标悬停在 anchor 上时,我希望将默认图标切换为图标白色。
效果应该类似于将鼠标悬停在导航栏中的 anchor 上 here
这是怎么做到的?
最佳答案
您使用 CSS 伪类 :hover 来设置不同的背景:
.menulink:hover { background-image: url('alternative_sprite.png'); }
关于css - 鼠标悬停时切换图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11613157/