如何在同一页面定义两种不同颜色的链接

643 views

因为设计人员的需要,要在同一页面弄两种颜色的链接,故找到如下方法

<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>还没有加载,所以不能够起作用。

Category 经验记录 Tagged , , , , Post a comment or leave a trackback: Trackback URL.

8 Comments

  1. Posted 2009年10月3日 at 09:37 | Permalink

    是不是漏写选择器了呀,这样没效果的

    [回复]

    aisinvon Reply:

    @万戈, 是的,谢谢提醒,得要把上面的style1和2加到下面的代码中

    [回复]

  2. Posted 2009年10月3日 at 12:19 | Permalink

    今天中秋节,大剑祝您及您的家人节日快乐,身体健康,万事如意!

    [回复]

    aisinvon Reply:

    @大剑, 谢谢,也同样祝您及家人节日快乐哦

    [回复]

  3. Posted 2009年10月3日 at 14:42 | Permalink

    节日快乐哈

    [回复]

    aisinvon Reply:

    @先看看, 同乐同乐

    [回复]

  4. Posted 2009年10月3日 at 19:20 | Permalink

    都不懂,技术不行·

    [回复]

    aisinvon Reply:

    @Xioubin, 不是干这个的话那不一定要懂的

    [回复]

  5. Posted 2009年10月3日 at 19:21 | Permalink

    中秋佳节,佘星星祝您阖家欢乐!身体健康!万事如意!

    正准备对网站的链接调整的,刚好学习了。

    谢谢分享!

    [回复]

    aisinvon Reply:

    @佘星星, 也祝你全家节日快乐啊。虽说节日快过完了

    [回复]

  6. Posted 2009年10月4日 at 08:24 | Permalink

    看不明白。祝黄金周愉快,玩得尽兴。

    [回复]

    aisinvon Reply:

    @太阳博客, 同乐同乐啊

    [回复]

  7. Posted 2009年10月4日 at 14:42 | Permalink

    看不懂过!

    [回复]

  8. Posted 2009年10月10日 at 11:17 | Permalink

    哈,这我还知道。ps:body中的a标签忘了加class啦。。

    [回复]

    aisinvon Reply:

    @蛋王, 哈哈,恭喜蛋王答对啦

    [回复]

    aisinvon Reply:

    @蛋王, 再奖你一个0蛋

    [回复]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>