码迷,mamicode.com
首页 > Web开发 > 详细

html 去掉html超链接下划线

时间:2015-03-28 10:06:09      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:

去掉html超链接下划线  

2012-08-30 17:31:00|  分类: css|举报|字号 订阅

 
 
我们可以用CSS语法来控制超链接的形式、颜色变化。

  下面我们做一个这样的链接:未被点击时超链接文字无下划线,显示为蓝色;当鼠标在链接上时有下划线,链接文字显示为红色;当点击链接后,链接无下划线,显示为绿色。

  实现方法很简单,在源代码的<head>和<head>之间加上如下的CSS语法控制:

   <style type="text/css">
   <!--
   a:link { text-decoration: none;color: blue}
   a:active { text-decoration:blink}
   a:hover { text-decoration:underline;color: red} 
   a:visited { text-decoration: none;color: green}
   --> 
   </style>

  其中:
  a:link 指正常的未被访问过的链接;
  a:active 指正在点的链接;
  a:hover 指鼠标在链接上;
  a:visited 指已经访问过的链接;
  text-decoration是文字修饰效果的意思;
  none参数表示超链接文字不显示下划线;
  underline参数表示超链接的文字有下划线

   同样,如果讲none替换成overline则给超链接文字加上划线,换成line-through给超链接文字加上删除线,blink则使文字在闪烁。

html 去掉html超链接下划线

标签:

原文地址:http://www.cnblogs.com/lovesy2413/p/4373641.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!