半透明 转载

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>鼠标经过图片半透明效果,支持Firefox/IE</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style type="text/css">
      body {background:#000;}
      .img_link{filter:alpha(opacity=50); /* IE */
            -moz-opacity:0.5; /* Moz + FF */
            opacity:0.5; /* 支持CSS3的浏览器(FF 1.5也支持)*/
          }
      .img_link:hover {
            filter:alpha(opacity=100); /* IE */
            -moz-opacity:1; /* Moz + FF */
           opacity:1; /* 支持CSS3的浏览器(FF 1.5也支持)*/
           }
    </style>
  </head>
  <body>
   <img class="img_link" src="http://www.tmxhx.com/attachments/month_0808/k2008823103739.jpg" alt="测试效果"  onMouseOver="this.className='null'" onMouseOut="this.className='img_link'" />
  </body>
</html>

posted @ 2011-03-20 20:27  简单不简单  阅读(147)  评论(0编辑  收藏  举报