前端集合 - 关注前端技术和互联网免费资源

关注前端技术和互联网免费资源

分类儿

页面儿

搜索儿

前端集合 RSS订阅
Home » 经验记录 » 如何在同一页面定义两种不同颜色的链接

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

发布者:前端集合 // 发布时间:2009-10-03 08:30:16 // 分类:经验记录 // 访问: 3,445 次 // 热度:

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

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

Tags: CSS, xhtml, 设计, 同一页面, 不同颜色链接

设置photoshop、Dreamweaver等程序的文件关联>>  << 雌雄同体
Top