电脑软硬件应用网
当前位置: 电脑软硬件应用网 > 设计学院 > 网页设计 > 正文
一款用css(样式表)制作的很酷的立体按扭
一款用css(样式表)制作的很酷的立体按扭
2005-12-30 19:13:51  文/45IT收集   出处:电脑软硬件应用网   

<style type="text/css">
<!--
a:link, a:visited, a:active, a:hover{text-decoration:none}
//-->
</style>
<script language="JavaScript">
<!--
if (!document.layers){

// 选择字体大小和颜色
Width=100;
Font='Verdana';
FontSize=12;
AFontColor='#ffffff';
BFontColor='#ffffff';
CFontColor='#ffffff';
FontWeight='normal';  //普通或黑体
BackGround='#0080ff'; //与背景色一致
BorderDepth=1;
BorderLight='#00ccff';
BorderShad='#000000';

//以下不需要修改
function On(id){
with(id.style){
color=BFontColor;
borderTopColor=BorderLight;
borderLeftColor=BorderLight;
borderRightColor=BorderShad;
borderBottomColor=BorderShad;
}
}
function Off(id){
with(id.style){
color=AFontColor;
borderTopColor=BackGround;
borderLeftColor=BackGround;
borderRightColor=BackGround;
borderBottomColor=BackGround;
}
}
function Down(id){
with(id.style){
color=CFontColor;
borderTopColor=BorderShad;
borderLeftColor=BorderShad;
borderRightColor=BorderLight;
borderBottomColor=BorderLight;
}
}
function Link(Url,Txt){
document.write("<a href='"+Url+"'>"
+"<div style='position:relative;"
+"width:"+Width+"px;height:"+FontSize+"px;"
+"border-width:"+BorderDepth+"px;"
+"border-color:"+BackGround+";"
+"border-style:solid;"
+"padding:"+FontSize/3+"px;"
+"background:"+BackGround+";"
+"font-family:"+Font+";"
+"font-size:"+FontSize+"px;"
+"line-height:"+FontSize*1.2+"px;"
+"font-weight:"+FontWeight+";"
+"text-align:left;"
+"color:"+AFontColor+";"
+"margin-top:2px;"
+"cursor:hand'"
+"onMouseOver='javascript:On(this)'" 
+"onMouseOut='javascript:Off(this)'" 
+"onMouseDown='javascript:Down(this)'>"
+Txt+"</div></a>");
}
}
function Temp(){
alert("TEST");
}
//-->
</script>

<script language="JavaScript">
<!-- 
if (!document.layers){
//This table stops oddness in NS6!!!
if (document.getElementById&&!document.all){
document.write("<div style='position:relative'>"
+"<table border='0' cellpadding='0' cellspacing='0'>"
+"<tr><td valign='top'>");
}

Link('http://www.yahoo.com','Yahoo');
Link('http://www.google.com','Google');
Link('http://www.altavista.com','Alta Vista');
Link('http://www.lycos.com','Lycos');
Link('http://www.hotbot.com','Hotbot');


if (document.getElementById&&!document.all){
document.write("</td></tr></table></div>");
}
}
//-->
</script>

http://nic-002.nicchina.com/

  • 上一篇文章:

  • 下一篇文章:
  • 最新热点 最新推荐 相关文章
    页面自动跳转的几种实现方法
    网站内容的四种分类形式 或多或少的…
    如何指定规范网页?rel="canonical"
    浅谈网站评论体系设计的不足之处
    网页中“上一篇”“下一篇”设计思考
    网页设计进度指示器帮助用户预测步骤
    网页用户体验:网页注册表单设计分析
    网页设计常出现8大问题
    网页设计的形象思维归纳
    彻底去掉动易内容页顶部的“改变图片…
    关于45IT | About 45IT | 联系方式 | 版权声明 | 网站导航 |

    Copyright © 2003-2011 45IT. All Rights Reserved 浙ICP备09049068号