注册 登录
编程论坛 WEB前端(UI)

[求助]超链接样式出错!问题很简单就是实现不了效果?

dushui265 发布于 2007-11-14 09:24, 1043 次点击

我做的页面给超链接加个样式,可是鼠标经过的时候不能显示下划线,而且颜色也不变,实现不了效果,有高手帮我看下是那里出错了,如果我把超链接样式删了通过Dreamweaver界面操作来添加,就可以实现效果,为什么手动输入下面的样式代码就不能实现,代码如下:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--

a:link {color: #0000CC;font-size:10pt;text-decoration: none;}
a:hover {font-size: 10pt;color: #FF0000;text-decoration: underline;}
a:visited {color: #FF3399;font-size:10pt;text-decoration: none;}

-->
</style>
</head>
<body>
<table width="99%" border="0" align="center">
<tr>
<td align="center" valign="middle" ><a href="#">部门主页</a></td>
<td align="center" valign="middle" ><a href="#">部门首页</a></td>
<td align="center" valign="middle"><a href="#">部门概况</a></td>
<td align="center" valign="middle"><a href="#">部门设置</a></td>
<td align="center" valign="middle"><a href="#">精品课程</a></td>
</tr>
</table>
</body>
</html>

3 回复
#2
雨帆2007-11-14 14:26

<style type="text/css">
<!--
a:link {color: #0000CC;font-size:10pt;text-decoration: none;}
a:hover {font-size: 10pt;color: #FF0000;text-decoration: underline;}
a:visited {color: #FF3399;font-size:10pt;text-decoration: none;}

-->
</style>

呵呵,你将我标蓝色的部分来换一下位置,看看你需要的效果出来了没有!
如下:
<style type="text/css">
<!--
a:link {color: #0000CC;font-size:10pt;text-decoration: none;}
a:visited {color: #FF3399;font-size:10pt;text-decoration: none;}
a:hover {font-size: 10pt;color: #FF0000;text-decoration: underline;}


-->
</style>

这是CSS优先级的关系影响的。

#3
lmhllr2007-11-14 14:56
顶楼上斑竹!!
#4
dushui2652007-11-16 16:18

你们真是太有才了,原来不能颠倒顺序啊,我还不知道呢,这次一定记住了,谢谢

1