首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

同一页面里超级链接的两种不同的效果的样式实现解决办法

2012-03-03 
同一页面里超级链接的两种不同的效果的样式实现比如:移动到一类超级链接显示红色;移动到另一类超级链接显

同一页面里超级链接的两种不同的效果的样式实现
比如:

移动到一类超级链接   显示红色;

移动到另一类超级链接   显示蓝色;


下面代码不对,请高手指点:
<HTML>
<HEAD>
<TITLE>   New   Document   </TITLE>
<META   NAME= "Generator "   CONTENT= "EditPlus ">
<META   NAME= "Author "   CONTENT= " ">
<META   NAME= "Keywords "   CONTENT= " ">
<META   NAME= "Description "   CONTENT= " ">
<style>
.c   a:link       {COLOR:red     ;   FONT-SIZE:   11pt;font-weight:   bold;   FONT-FAMILY:   "宋体 ";   text-decoration:none;   }  
.c   a:visited{COLOR:blue   ;   FONT-SIZE:   11pt;font-weight:   bold;   FONT-FAMILY:   "宋体 ";   text-decoration:   none;}
.c   a:hover     {COLOR:green     ;   FONT-SIZE:   11pt;   font-family:   "宋体 ";   text-decoration:underline;}
.c   a:active   {COLOR:black;   FONT-SIZE:   11pt;   font-family:   "宋体 ";   text-decoration:underline;}

.d   a:link       {COLOR:gold;   FONT-SIZE:   11pt;font-weight:   bold;   FONT-FAMILY:   "宋体 ";   text-decoration:none;   }  
.d   a:visited{COLOR:yellow;   FONT-SIZE:   11pt;font-weight:   bold;   FONT-FAMILY:   "宋体 ";   text-decoration:   none;}
.d   a:hover     {COLOR:olive;   FONT-SIZE:   11pt;   font-family:   "宋体 ";   text-decoration:underline;}
.d   a:active   {COLOR:white;   FONT-SIZE:   11pt;   font-family:   "宋体 ";   text-decoration:underline;}
</style>
</HEAD>

<BODY>

<a   href= "aa "   class= "c "> cccccccc </a>

<a   href= "aa "   class= "d "> dddddddd </a>
</BODY>
</HTML>


[解决办法]
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME= "Generator " CONTENT= "EditPlus ">
<META NAME= "Author " CONTENT= " ">
<META NAME= "Keywords " CONTENT= " ">
<META NAME= "Description " CONTENT= " ">
<style>
a.c:link {COLOR:red ; FONT-SIZE: 11pt;font-weight: bold; FONT-FAMILY: "宋体 "; text-decoration:none; }
a.c:visited{COLOR:blue ; FONT-SIZE: 11pt;font-weight: bold; FONT-FAMILY: "宋体 "; text-decoration: none;}
a.c:hover {COLOR:green ; FONT-SIZE: 11pt; font-family: "宋体 "; text-decoration:underline;}
a.c:active {COLOR:black; FONT-SIZE: 11pt; font-family: "宋体 "; text-decoration:underline;}

a.d:link {COLOR:gold; FONT-SIZE: 11pt;font-weight: bold; FONT-FAMILY: "宋体 "; text-decoration:none; }
a.d:visited{COLOR:yellow; FONT-SIZE: 11pt;font-weight: bold; FONT-FAMILY: "宋体 "; text-decoration: none;}
a.d:hover {COLOR:olive; FONT-SIZE: 11pt; font-family: "宋体 "; text-decoration:underline;}
a.d:active {COLOR:white; FONT-SIZE: 11pt; font-family: "宋体 "; text-decoration:underline;}
</style>
</HEAD>

<BODY>

<a href= "aa " class= "c "> cccccccc </a>

<a href= "aa " class= "d "> dddddddd </a>


</BODY>
</HTML>
[解决办法]
A.a1:link {
color: #000000;
text-decoration: none;
font-size: 14px;
font-weight: bold;
}
A.a1:visited {
color: #000000;
font-size: 14px;
font-weight: bold;
text-decoration: none;
}
A.a1:hover {
text-decoration: underline;
color: #4E00FF;
font-size: 14px;
font-weight: bold;

}
A.a1:active {
color: #4E00FF;
text-decoration: none;
font-size: 14px;
font-weight: bold;
}可定在外部CSS文件,引用时 <a href= "aa " class= "a1 "> cccccccc </a> 另一个只需把颜色改变一下即可

热点排行