dreamwaver+css 链接问题

来源:百度知道 编辑:UC知道 时间:2024/05/10 23:15:15
sytle.css
.header a { color: #ffffff; text-decoration: none; font-size:15px; }
.body a { color: #006699; text-decoration: none }
.footer a { color: #ffffff; text-decoration: none }
'定义三个部分header body foot 部分的链接颜色。
a:visited { color: #003399; text-decoration: none }
a:active { color: #003399; text-decoration: none }
a:hover { color: #000000; text-decoration: none; position: relative; right: 0px; top: 0px }

要求:三个地方,链接显示不同颜色。
可是出来后,header和footer部分的第一个链接是用的body部分的链接。怎么回事?其他的链接都正常。不知道怎么改了,代码也没有错呀。

具体的网页:http://www.tekunoeito.com/gsjj.htm
希望网页制作的朋友帮帮忙
好像,还是不行呀。能不能帮一下忙看一下是哪里出错了。

1.链接的CSS代码编写时有顺序的,link,visited,hover,active,一定要按这个顺序,否则会出现错误。
2.CSS里,后写的代码会覆盖掉先写的代码。

所以你要先定义大范围的a的定义,然后再详细定义每个区块的a的具体定义。

.header a:link{ color: #ffffff; text-decoration: none; font-size:15px; }
.body a:link{ color: #006699; text-decoration: none }
.footer a:link{ color: #ffffff; text-decoration: none }
你把上面的替换成这个,这样就对了

你这个问题我也遇到过,关键是把a和a:link区分开来

A.header:visited,hover{ color: #ffffff; text-decoration: none; font-size:15px; }

class="header"
其他部份类似
还有一点如果你把上面这个换成body那么整个页面就是body的样式了,BODY包括了header/footer

这样不行啊?没看到具体的HTML你只有自己再想想啦,应该没有错呀,肯定是你有什么小的细节没注意啦

a{ color: #006699; text-decoration: none }
a:visited { color: #003399; text-decoration: none }
a:active { color: #003399; text-decoration: none }
a:hover { color: #000000; text-decoration: none; position: relative; right: 0px; top: 0px }
.header a{ color: #ffffff; text-decoration: none; font-si