html去掉a标签下划线

html-css010

html去掉a标签下划线,第1张

a{text-decoration: none}//这个是设置a标签的默认状态去除下划线

a:visited{text-decoration: none}//这个是设置a标签的访问过后的状态去除下划线

a:hover {text-decoration: none}//这个是设置a标签的鼠标覆盖状态去除下划线

a:active{text-decoration:none}//这个是设置a标签的活跃状态去除下划线

1 正常情况下:<a>标签有下划线,其他的标签没有下划线

2 要是<a>标签有下划线,可以添加css样式:text-decoration:none去掉下划线

知识点

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

<style type="text/css">

<!--

a:link { text-decoration: nonecolor: blue}

a:active { text-decoration:blink}

a:hover { text-decoration:underlinecolor: red}

a:visited { text-decoration: nonecolor: green}

-->

</style>

其中:

a:link 指正常的未被访问过的链接;

a:active 指正在点的链接;

a:hover 指鼠标在链接上;

a:visited 指已经访问过的链接;

text-decoration是文字修饰效果的意思;

none参数表示超链接文字不显示下划线;

underline参数表示超链接的文字有下划线