html超连接问题
如: ”友情连接“ 我想定义为超连接另一个页面 当鼠标指向“友情连接”(开始没有下画线) 时要让它下画线并显示不同的颜色
能否给个代码?
如下面的例子,当我预览时总是一开始就有个下画线
脚本说明:
第一步:把如下代码加入<head>区域中
<SCRIPT language="JavaScript">
<!--
//if explorer (4.x)
if (document.all) {
layerRef='document.all'
styleRef='.style.'
}
//else if netscape (4.x)
else if (document.layers) {
layerRef='document.layers'
styleRef='.'
}
else{
alert("你使用的浏览器可能看不到效果。")
}
function show(){
eval(layerRef+'["divTest"]'+styleRef+'visibility="visible"')
}
function hide(){
eval(layerRef+'["divTest"]'+styleRef+'visibility="hidden"')
}
//-->
</SCRIPT>
第二步:把如下代码加入<body>区域中
<p align="center"><br>
<a href="javascript:hide('divText.html')">隐藏字符</a> <a href="javascript:show('divText.html')">显示字符</a>
<p align="center">
<div id="divTest" style="position:absolute; left:168px; width:440px; height:32px; top:210px; visibility: hidden">
<p align="center">对不起,代码不能随便看的,如果你真的想要,请与我联系!</a></p>
问题点数:40、回复次数:3Top
1 楼bencalie(Bencalie)回复于 2003-12-01 20:14:36 得分 13
<style>
a:link { text-decoration: none }
a:active { text-decoration: none }
a:visited { text-decoration: none }
a:hover { text-decoration: underline }
</style>Top
2 楼kingerq(多菜鸟)回复于 2003-12-01 20:15:14 得分 13
把以下代码加入head就可以了。
不用你那么麻烦啦。
<style type="text/css">
<!--
a:link {
color: #000000;
text-decoration: none;
}
a:hover {
color: #0000FF;
text-decoration: underline;
}
a:visited {
color: #000000;
text-decoration: none;
}
-->
</style>Top
3 楼monkeys(Myron.Liu)回复于 2003-12-01 20:26:44 得分 14
楼上说的没错:
<style type="text/css">
<!--
a:link {
color: #000000;
text-decoration: none;
}
a:hover {
color: #0000FF;
text-decoration: underline;
}
a:visited {
color: #000000;
text-decoration: none;
}
-->
</style>
Top




