html中对a标签的css样式的常用处理方法(删除下划线)

这是w3school上的原话:

链接的四种状态:
a:link - 普通的、未被访问的链接
a:visited - 用户已访问的链接
a:hover - 鼠标指针位于链接的上方
a:active - 链接被点击的时刻

对于a标签text-decoration属性:
这是删除下划线必备的属性“text-decoration”

text-decoration是文字修饰效果的意思;
none参数表示超链接文字不显示下划线;
underline参数表示超链接的文字有下划线
代码实现

/*a:link 指正常的未被访问过的链接;*/
a:link {
    
    
    text-decoration: none;
}
/* a:active 指正在点的链接; */
a:active {
    
    
    color:red;
}
/*a:visited 指已经访问过的链接; */
a:visited {
    
    
    color:yellow;
}
/*a:hover 指鼠标在链接上; */
a:hover {
    
    
   color:green;
}

猜你喜欢

转载自blog.csdn.net/qq_49249150/article/details/108024562