日期:2014-05-17 浏览次数:20577 次
<html> <head> <title>CSS渐变色</title> <style type="text/css"> .test { width:560px; height:400px; background-color:#FFFFFF; padding:10px 8px 6px; border: 1px solid #000; margin-bottom:10px; FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#b8c4cb,endColorStr=#f6f6f8);/*IE6*/ background:-moz-linear-gradient(top,#b8c4cb,#f6f6f8);/*非IE6的其它*/ background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#b8c4cb), to(#f6f6f8));/*非IE6的其它*/ } </style> </head> <body> <div class="test"> 用CSS生成的渐变色。源码来自:烈火下载 http://www.veryhuo.com/down </div> </body> </html><br /><center>如不能显示效果,请按Ctrl+F5刷新本页,更多网页代码:<a href='http://www.veryhuo.com/' target='_blank'>http://www.veryhuo.com/</a></center>
------解决方案--------------------
应该可以通过gadient做这种效果吧,ie不会。。
http://jsbin.com/amujel/edit#html,live
------解决方案--------------------
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>Js淡入淡出</title> <style> * { font-size:12px;} html { margin:0px; padding:0px; overflow:auto; } body { margin:0px; padding:15px; background-color:buttonface; } #w { position:absolute; width:480px; height:270px; overflow:hidden; border:2px groove #281; cursor:default; -moz-user-select:none; filter:alpha(opacity=100); } #t { line-height:20px; height:20px; width:480px; overflow:hidden; background-color:#27C; color:white; font-weight:bold; border-bottom:1px outset blue; text-align:center; } </style> </head> <body> <div id="w"> <div id="t">演示Windows的淡入淡出窗口</div> </div> </body> <script> (function(o,i,s){ i=1;s=0.01; setInterval(function(){ i+=s; s=i<0?0.01:(i>1?-0.01:s); if(o.filters)o.filters[0].opacity=i*100; else o.style.opacity=i; },1); })(document.getElementById("w")); </script> </html>