<style type="text/css">
.showCSS
{
event:expression(
onmouseover = function()
{
this.style.backgroundColor='#ff0000'
},
onmouseout = function()
{
this.style.backgroundColor='#ffffff'
}
)
}
</style>
<div class="showCSS">把鼠标放上去试试看!</div>
本文介绍了一种使用纯CSS实现的简单鼠标悬停效果。通过内联样式与事件属性结合,当鼠标移动到指定元素上时,背景颜色会发生变化。

648

被折叠的 条评论
为什么被折叠?



