我新编网页,导航条、下面栏目都有文字链接,设置了a:hover , a:link 样式,但达不到理想效果,导航条想指针移上去时不变色,只多显示下划线,而栏目内标题文字既变色,又多下划线,可我通过 a:hover 设置后,导航条内反变了色,需要变色的标题文字却不变色。请问如何用CSS样式表在同页用dreamweaver分别设置不同效果的文字链接。a:hover a:link 等好象不能设置两次。先谢过!
<style>
.a1:hover{style1}
.a2:hover{style2}
</style>
<a href=# class=a1>Text1</a>
<a href=# class=a2>Text1</a>
两套,可以这样设!
.subtitle {
font-family: "宋体";
font-size: 9pt;
font-weight: bold;
color: #FFFFFF;
text-align: center;
vertical-align: middle;
}
a:link {
font-family: "宋体";
font-size: 9pt;
color: #316395;
text-decoration: underline;
}
a:hover {
font-family: "宋体";
font-size: 9pt;
color: #FF0000;
}
a:visited {
font-family: "宋体";
font-size: 9pt;
color: #316395;
text-decoration: underline;
}
.title {
font-family: "宋体";
font-size: 9pt;
color: #FFFFFF;
text-align: center;
vertical-align: middle;
}
.head {
font-family: "宋体";
font-size: 9pt;
}
a.nav:link {
font-family: "宋体";
font-size: 9pt;
color: #000000;
}
a.nav:active {
font-family: "宋体";
font-size: 9pt;
color: #000000;
}
a.nav:hover {
font-family: "宋体";
font-size: 9pt;
color: #996633;
}
.headw {
font-family: "宋体";
font-size: 9pt;
color: #FFFFFF;
}
a.top:link {
font-family: "宋体";
font-size: 9pt;
color: #FFFFFF;
text-decoration: none;
}
a.top:visited {
font-family: "宋体";
font-size: 9pt;
color: #FFFFFF;
text-decoration: none;
}
a.top:hover {
font-family: "宋体";
font-size: 9pt;
color: #FF0000;
text-decoration: underline overline;
}
.buttonstyle
{
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
FONT-SIZE: 9pt; BACKGROUND: #c0c0c0;
BORDER-LEFT: #ffffff 1px solid;
COLOR: #000000;
BORDER-BOTTOM: #ffffff 1px solid;
}.redtitle {
font-family: "宋体";
font-size: 9pt;
color: #FF0000;
}
a.other:link {
font-family: "宋体";
font-size: 9pt;
color: #0000FF;
text-decoration: underline;
}
a.other:visited {
font-family: "宋体";
font-size: 9pt;
color: #6699cc;
text-decoration: underline;
}
a.other:hover {
font-family: "宋体";
font-size: 9pt;
color: #666666;
}
p {
font-family: "宋体";
font-size: 9pt;
}
我的标题样式是这样的。
<a href="#" class="nav">导航链接</a>
顶部的样式。
<a href="#" class="top">顶部链接</a>
一般的链接样式
<a href="3">链接</a>