当前位置:Gxlcms > css > css如何清除下划线?css清除下划线有哪些方法

css如何清除下划线?css清除下划线有哪些方法

时间:2021-07-01 10:21:17 帮助过:49人阅读

css怎么清除下划线?css去除下划线方法有哪些?很多人可能还不知道怎么操作,下面我们来讲解一下。css如何清除下划线?css清除下划线方法在css中,我们可以使用text-decoration属性来表示下划线和删除线等样式,首先我们要了解一下text-decoration属性。

text-decoration属性一共有五个值,分别是none,blink,underline,line-through,overline,其中underline就表示下划线。语法如下:

div{text-decoration:none}表示:一般去掉下划线

div{text-decoration:underline}表示一般添加下划线样式

div{text-decoration:line-through}一般表示贯穿线

div{text-decoration:overline}设置上划线样式

代码如下:

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>CSS测试</title>
  6. <style>
  7. h1{
  8. text-decoration:underline
  9. }
  10. a{
  11. text-decoration:none
  12. }
  13. </style>
  14. <body>
  15. <h1>Gxl网</h1>
  16. <p>
  17. 有关<a href="http://www.gxlcms.com/course/list/17.html" target="_self">JavaScript教程</a>
  18. </p>
  19. </body>
  20. </html>

效果如图:

css如何清除下划线?css清除下划线方法

css去掉下划线只要我们把text-decoration属性改成none就可以了,并不是很难,在HTML中,我们可以使用u标签来加下划线,但是在css中我们只能使用text-decoration属性,我们想把下划线设置成红色,只要我们保持和字体的颜色相同就可以了。

以上就是css如何清除下划线的全部介绍,如果你想了解更多有关CSS教程,请关注Gxl网。

以上就是css如何清除下划线?css清除下划线有哪些方法的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行