链接特效-用链接模拟一个按钮
——————————————————————
<script type="text/javascript">
//自定义按钮的样式
function defineLinkClick(){
//获得链接的DOM
var myLink = document.getElementById("myLink");
myLink.style.fontSize = '16px'; //字体
myLink.style.textAlign = 'center'; //字符对齐
myLink.style.color = 'white'; //颜色
myLink.style.padding = '4px 10px'; //内距离
myLink.style.margin = '3px'; //外边框
myLink.style.background = 'gray'; //背景色
myLink.style.textDecoration = 'none';//文本样式
//边框颜色,造成深浅效果来模仿按钮
myLink.style.borderColor = '#EEEEEE #717171 #717171 #EEEEEE';
myLink.style.borderStyle = 'solid'; //边框样式为实线
myLink.style.borderWidth = '1px'; //边框的粗细
}
</script>
————————————————————————
<body onload="defineLinkClick();" style="text-align:center;">
<!-- 定义X链接 -->
<a href="#" id="myLink">按钮式链接</a>
</body>
————————————————————————