因为设计人员的需要,要在同一页面弄两种颜色的链接,故找到如下方法:
<html>
<head>
<title>中国站长天空-网页特效-文本特效-同一页面两种不同颜色的超链接</title>
<meta http-equiv=”content-Type” content=”text/html;charset=gb2312″>
<!–把下面代码加到<head>与</head>之间–>
<style type=”text/css”>
<!–
A.style1:link {
text-decoration: none;
color: #ff9966;
font-weight: normal;
}
A.style1:visited {
text-decoration: none;
color: #ff9966;
font-weight: normal;
}
A.style1:active {
text-decoration: none;
color: #ff9966;
font-weight: normal;
}
A.style1:hover {
text-decoration: underline;
color: #ff0000;
font-weight: normal;
}
A.style2:link {
text-decoration: underline;
color:#ff3322;
font-weight: normal;
}
A.style2:visited {
text-decoration: underline;
color: #ff3322;
font-weight: normal;
}
A.style2:active {
text-decoration: none;
color: #0033ff;
font-weight: normal;
}
A.style2:hover {
text-decoration: none;
color: #0033ff;
font-weight: normal;
}
–>
</style>
</head>
<body>
<!–把下面代码加到<body>与</body>之间–>
<a href=”http://www.zzsky.cn” target=”_blank”>中国站长天空</a><br><br>
<a href=”http://www.zzsky.cn” target=”_blank”>中国站长天空</a>
</body>
</html>
另外,说下不相关的:如果JS代码在页面中不起作用,如何解决?
当从页面代码中抽离出来的js单独放在head中不起作用时,那么可以尝试将其放在</body>或</html>后,因为可能有些js放在<head>还没有加载,所以不能够起作用。
8 Comments
是不是漏写选择器了呀,这样没效果的
[回复]
aisinvon Reply:
十月 4th, 2009 at 00:12
@万戈, 是的,谢谢提醒,得要把上面的style1和2加到下面的代码中
[回复]
今天中秋节,大剑祝您及您的家人节日快乐,身体健康,万事如意!
[回复]
aisinvon Reply:
十月 4th, 2009 at 00:10
@大剑, 谢谢,也同样祝您及家人节日快乐哦
[回复]
节日快乐哈
[回复]
aisinvon Reply:
十月 4th, 2009 at 00:10
@先看看, 同乐同乐
[回复]
都不懂,技术不行·
[回复]
aisinvon Reply:
十月 4th, 2009 at 00:10
@Xioubin, 不是干这个的话那不一定要懂的
[回复]
中秋佳节,佘星星祝您阖家欢乐!身体健康!万事如意!
正准备对网站的链接调整的,刚好学习了。
谢谢分享!
[回复]
aisinvon Reply:
十月 4th, 2009 at 00:09
@佘星星, 也祝你全家节日快乐啊。虽说节日快过完了
[回复]
看不明白。祝黄金周愉快,玩得尽兴。
[回复]
aisinvon Reply:
十月 4th, 2009 at 12:17
@太阳博客, 同乐同乐啊
[回复]
看不懂过!
[回复]
哈,这我还知道。ps:body中的a标签忘了加class啦。。
[回复]
aisinvon Reply:
十月 10th, 2009 at 19:11
@蛋王, 哈哈,恭喜蛋王答对啦
[回复]
aisinvon Reply:
十月 10th, 2009 at 19:11
@蛋王, 再奖你一个0蛋
[回复]