科技知识动态:如何使用text-decoration

导读跟大家讲解下有关如何使用text-decoration,相信小伙伴们对这个话题应该也很关注吧,现在就为小伙伴们说说如何使用text-decoration,小编也

跟大家讲解下有关如何使用text-decoration,相信小伙伴们对这个话题应该也很关注吧,现在就为小伙伴们说说如何使用text-decoration,小编也收集到了有关如何使用text-decoration的相关资料,希望大家看到了会喜欢。

我们在网页里常常会使用使用CSS代码来对象文字内容加上下划线。那么我们就要用到text-decoration了 ,如何使用呢?今天我们给大家好好介绍一下。

使用CSS属性单词:

text-decoration : none || underline || blink || overline || line-through

text-decoration下划线CSS单词值参数:

none :  无装饰

blink :  闪烁

underline :  下划线

line-through :  贯穿线

overline :  上划线

text-decoration:none 无装饰,通常对html下划线标签去掉下划线样式

text-decoration:underline 下划线样式

text-decoration:line-through 删除线样式-贯穿线样式

text-decoration:overline 上划线样式

HTML常规下划线标签

在HTML u标签下划线标签“U”即可对对象文字加html下划线。

实例:

<u>我被U标签加下滑线</u>

CSS控制对象下划线属性样式

html u下划线与CSS下划线对比应用案例

CSS去掉html标签划线样式

如果我们想去掉对应html中删除线s标签删除线样式、去掉html u下划线、去掉html上划线样式。

1、去掉html s删除线贯穿线样式

.p s{text-decoration:none}

去掉p类对象盒子里html s标签样式属性

2、去掉html u下划线样式

.p u{text-decoration:none}

去掉p类对象盒子里u标签下划线线样式属性

五、超链接下划线高级运用 - TOP

我们接下来为大家讲解常见CSS 超链接,当随便经过时候文字对象被加下划线。

代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>下划线演示</title> <style> .yangshi a{ text-decoration:none;} .yangshi a:hover{ text-decoration:underline;} </style> </head> <body> <p> <span class="yangshi"> <a href="http:/www.php.cn">p</a> </span> </p> </body> </html>

请将以上代码复制新建HTML即可查看该实例样式。

我们进行对3个盒子对象分别设置对象内文字下划线、文字删除线样式、字体上划线样式。

1、css代码片段:

.p{text-decoration:underline}

.p_1{text-decoration:line-through}

.p_2{text-decoration:overline}

2、html代码片段:

<p class="p">我被加下划线</p>

<p class="p_1">我被加贯穿删除线</p>

<p class="p_2">我被加上划线</p>

介绍了这么多相信大家已经掌握了text-decoration,有需要的朋友可以保存一下,也请大家持续关注本站的其他更新。

相关阅读:

html的注释有什么作用

CSS里怎么清除浮动

html中的label标签使用方法

以上就是如何使用text-decoration的详细内容,更多请关注php中文网其它相关文章!

来源:php中文网

免责声明:本文由用户上传,如有侵权请联系删除!