关于javascript的一些小问题

来源:百度知道 编辑:UC知道 时间:2024/05/31 14:54:51
<style>
/* alixixi.com */
*{ margin:0; padding:0; list-style:none; font-size:12px; line-height:1.8;}
body{ background: #FFFFFF}
#info{padding:50px;}
#infobox{padding:0px 20px;background-color: #000088;}
#center{background:#ABBAAC; border-top:2px solid #333; padding:21px;}
.c{ clear:both; height:1px; overflow: hidden; background:#333}
#infobox li{ border-right:1px solid black; float:left; margin-right:1px; text-align:center;margin-top:-4px; }
a{ width:100px;line-height:30px; display:block;}
a:link,a:visited{color:#000;background:#FF9900;text-decoration: none;}
a:hover,a:active{ color:#FFFF00;background:#000;}

/*以是下显示TIP的内容*/
#infobox span{ display:none; }
#infobox a:hover span{display: block;position:absolute;border:1px solid #000088;background: #FFFFFF;margin-top:26px!important; margin-top:20px;color:#000;padding:5px;white-space: nowrap;}

</style>
</head>
<body>

.......
你的代码里面没有任何javascript,取而代之的是CSS

在你的CSS里面有这么一段:
a{ width:100px;line-height:30px; display:block;}
a:link,a:visited{color:#000;background:#FF9900;text-decoration: none;}
a:hover,a:active{ color:#FFFF00;background:#000;}
这里对标签所有的名字为a的标签设置了同样的样式,如果你希望某一个标签为之不同,那么你就为这个标签添加一个id,并单独设置CSS

比如你这里的标签,定义一个id为web:
<a id="web" href="">网页</a>
那么你可以在CSS里面这样写就没有背景了:
#web:link,#web:visited{background:transparent;}

这是css

把有关a标记的css删了就好
下面三行就是

a{ width:100px;line-height:30px; display:block;}
a:link,a:visited{color:#000;background:#FF9900;text-decoration: none;}
a:hover,a:active{ color:#FFFF00;background:#000;}

对 CSS的事