本文摘自PHP中文网,作者V,侵删。
css去掉下划线的方法:可以利用text-decoration属性来实现,如【text-decoration: none;】,属性值none表示没有文本装饰。

本文操作环境:windows10系统、css 3、thinkpad t480电脑。
可以使用text-decoration 属性来取消文本下划线,该属性规定添加到文本的修饰,下划线、上划线、删除线等。
基本语法:
1 2 3 4 5 6 7 8 | /*关键值*/
text-decoration: none; /*没有文本装饰*/
text-decoration: underline red; /*红色下划线*/
text-decoration: underline wavy red; /*红色波浪形下划线*/
/*全局值*/
text-decoration: inherit;
text-decoration: initial;
text-decoration: unset;
|
属性值:
(学习视频分享:css视频教程)
代码示例如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | <!DOCTYPE html>
< html >
< head >
< meta charset = "utf-8" >
< title >php中文网(php.cn)</ title >
< style >
h1.under {
text-decoration: underline;
}
h1.over {
text-decoration: overline;
}
p.line {
text-decoration: line-through;
}
p.blink {
text-decoration: blink;
}
a.none {
text-decoration: none;
}
p.underover {
text-decoration: underline overline;
}
</ style >
</ head >
< body >
< h1 class = "under" >下划线</ h1 >
< p class = "line" >删除线</ p >
< p class = "blink" >闪烁效果,但浏览器不会显示</ p >
< h1 class = "over" >下划线</ h1 >
< p >这是一个 < a class = "none" href = "#" >链接</ a >,默认情况下链接是有下划线的,这边我们移除它。</ p >
< p class = "underover" >上划线与下划线</ p >
</ body >
</ html >
|
相关推荐:CSS教程
以上就是css怎么去掉下划线的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
css和div的区别是什么
css怎么设置超链接文本为白色
css网页布局小技巧
css如何设置透明背景
css中文字超出div怎么办
css怎么去掉属性
css中auto什么意思
jq如何判断css是否存在
css如何禁止选中页面内容
css怎么改变光标颜色
更多相关阅读请进入《css》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » css怎么去掉下划线