- <!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>測試一下半透明效果</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <style type="text/css">
- body {
- background:#000;
- }
- .a {
- filter:alpha(opacity=50); /* IE */
- -moz-opacity:0.5; /* Moz + FF */
- opacity:0.5; /* 支持CSS3的瀏覽器(FF 1.5也支持)*/
- }
- .a :hover {
- filter:alpha(opacity=100); /* IE */
- -moz-opacity:1; /* Moz + FF */
- opacity:1; /* 支持CSS3的瀏覽器(FF 1.5也支持)*/
- }
- </style>
- </head>
- <body>
- <img class="a"
- src="http://www.fayaa.com/static/images/logo/snap_code.gif" alt="測試一下"
- onmouseover="this.className='b'" onmouseout="this.className='a'" />
- </body>
- </html>