一个不错的CSS模拟的按钮效果

12/19/2007来源:网页特效人气:4655

<style type="text/CSS">
<!--
.btnOFF{padding:3px;border:1px outset;cursor:pointer;background-color: green;width:100px;height:16px;text-align:center;}
.btnON{padding:3px;border:1px inset;background-color: #CCCC33;width:100px;height:16px;text-align:center;color:red;}
-->
</style>

<script language="javaScript">
<!--
function setEffect(link_id)
{
 var i;
 for(i=0;i<link.length;i++)
 {
  if(i != link_id)
  {
   link[i].className = "btnOFF";
  }
  else
  {
   link[i].className = "btnON";
  }
 }
}
//-->
</script>

<p align=center><span id="link" class="btnOFF" onclick="setEffect(0)">Google</span><span id="link" class="btnOFF" onclick="setEffect(1)">Baidu</span><span id="link" class="btnOFF" onclick="setEffect(2)">Sina</span><span id="link" class="btnOFF" onclick="setEffect(3)">Sohu</span><span id="link" class="btnOFF" onclick="setEffect(4)">CSDN</span><span id="link" class="btnOFF" onclick="setEffect(5)">knowsky</span></p>