通过CSS样式修改超链接颜色下划线

HTML文件:

<style type="text/css">
a:link {color:#000000;}      /* 未访问链接*/
a:visited {color:#00FF00;}  /* 已访问链接 */
a:hover {color:#FF00FF;}  /* 鼠标移动到链接上 */
a:active {color:#0000FF;}  /* 鼠标点击时 */
</style>

CSS文件:

a:link{color:#000000;}      /* 未访问链接*/
a:visited {color:#00FF00;}  /* 已访问链接 */
a:hover {color:#FF00FF;}  /* 鼠标移动到链接上 */
a:active {color:#0000FF;}  /* 鼠标点击时 */

去掉下划线可以将a标签的text-decoration属性改为none的即可!

text-decoration:none;

示例:

<html>  
  
<head>  
  
<style type="text/css">
a:link {color:#000000;}      /* 未访问链接*/
a:visited {color:#00FF00;}  /* 已访问链接 */
a:hover {color:#FF00FF;}  /* 鼠标移动到链接上 */
a:active {color:#0000FF;}  /* 鼠标点击时 */
</style>
<title>test css</title>  
  
</head>  
  
<body>  
  
<a>this a label</a>
  
</body>  
  
</html>  

以加载CSS文件方式

<html>  
  
<head>  
  
<link rel="stylesheet" href="wcss.css" type="text/css" />  
  
<title>test css</title>  
  
</head>  
  
<body>
<a>this a label</a>  
</body>
</html>

非常简单!

猜你喜欢

转载自blog.csdn.net/bjbz_cxy/article/details/79869822