css怎样清除下划线
更新:HHH   时间:2023-1-7


这篇文章将为大家详细讲解有关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}设置上划线样式

  代码如下:

  <!DOCTYPEhtml>

  <html>

  <head>

  <metacharset="utf-8">

  <title>CSS测试</title>

  <style>

  h2{

  text-decoration:underline

  }

  a{

  text-decoration:none

  }

  </style>

  <body>

  <h2>php中文网</h2>

  <p>

  有关<ahref="http://www.php.cn/course/list/17.html"target="_self">JavaScript教程</a>

  </p>

  </body>

  </html>

关于“css怎样清除下划线”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。

返回web开发教程...