posts - 5, comments - 2, trackbacks - 0, articles - 5
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

IE6.0不支持任意元素的hover伪类替代方案

Posted on 2009-11-23 22:46 Just Do It 阅读(854) 评论(0)  编辑  收藏 所属分类: HTML
IE7任意元素均支持hover的css伪类,IE6仅a元素支持,此时,可通过css里加入event:expression的方式来达到css控制的效果:

<html>
<head>
<style>
 .c
 
{
  background
:#ff0000;
   event
:expression(
      onmouseover=function(){
         this.style.backgroundColor='#FF0000'
;
      
}
,
      onmouseout=function()
{
         this.style.backgroundColor='#0000FF';
      
}

   );
 }
</style>
</head>
<body>
 
<form name="form1">
 
</form>
    
<input type="button" class="c" value="VALUE" />
</body>
</html> 

只有注册用户登录后才能发表评论。


网站导航: