<div class="htmlarea"> <textarea id="runcode96628"><style> .tb{width:100%;height:1px;overflow:hidden;background:rgb(250,100,0);margin:0 1px;} .lr{width:100%;height:20px;overflow:hidden;border-left:1px solid rgb(250,100,0);border-right:1px solid rgb(250,100,0);} .bg{width:100%;height:20px;overflow:hidden;} .button{position:relative;width:100%;height:20px;top:-20px;font- size:9pt;border:0;background:none;} </style> <div style="float:left;width:100;"> <div class="tb"></div> <div class="lr"> <div class="bg" id="bg"></div> <input class="button" id="button" type="button" value="美化了的按鈕"> </div> <div class="tb"></div> </div> <script> function rgb(){ ID=arguments[0] oRGB=eval(arguments[1]) nRGB=eval(arguments[2]) var IMG="" for(i=20;i>0;i=i-2){ RGB="rgb("+(oRGB[0]-1)+","+(oRGB[1]-1)+","+(oRGB[2]-1)+")" IMG+="<img style=\"width:100%;height:1px;background:"+RGB+"\" alt="css不用圖片美化按鈕_經驗交流" >" } for(i=20;i>0;i=i-2){ RGB="rgb("+(nRGB[0]-1)+","+(nRGB[1]-1)+","+(nRGB[2]-1)+")" IMG+="<img style=\"width:100%;height:1px;background:"+RGB+"\" alt="css不用圖片美化按鈕_經驗交流" >" } eval(ID+".innerHTML=IMG") } rgb("bg",[255,180,20],[255,140,20]) button.onmouseover=function(){rgb("bg",[255,200,20],[255,160,20])} button.onmouseout=function(){rgb("bg",[255,180,20],[255,140,20])} </script></textarea><br><input onclick="runEx('runcode96628')" type="button" value="運行代碼"><input onclick="doCopy('runcode96628')" type="button" value="複製代碼"><input onclick="doSave(runcode96628)" type="button" value="保存代碼">[Ctrl A 全選注:<a href="/article/23421.htm" title="查看具體詳情" target="_blank">如需引入外部Js需刷新才能執行</a>]</div>