css去掉下划线的方法:可以 利用 text-decoration属性来实现,如【text-decoration: none;】,属性值none表示没有文本装饰。
本文操作环境:windows10系统、css 3、 ThinkPad t480 电 脑。
可以使用text-decoration 属性来取消文本下划线,该属性规定添加到文本的修饰,下划线、上划线、删除线等。
基本语法:
/*关 键值 */ text-decoration: none; /*没有文本装饰*/ text-decoration: underline red ; /* 红色 下划线*/ text-decoration: underline wavy red; /*红色波浪形下划线*/ /*全局值*/ text-decoration: inher IT ; text-decoration: initial; text-decoration: unset;
属性值:
none 默认。定义标准的文本。
underline 定义文本下的一条线。
overline 定义文本上的一条线。
line -t hr ough 定义穿过文本下的一条线。
blink 定义闪烁的文本。
inherit 规定 应该 从父元素继承 text-decoration 属性的值。
(学习视频分享:css视频教程)
代码示例如下:
<!DOCTY PE ht ML >
<html>
<head>
< ;m eta charset="utf-8">
<title>(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怎么去掉下划线 全部内容,希望文章能够帮你解决 css怎么去掉下划线 所遇到的问题。
如果觉得 网站内容还不错, 推荐好友。
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did199476