css中text-decoration-line属性如何使用-创新互联

这篇文章将为大家详细讲解有关css中text-decoration-line属性如何使用,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

10年积累的成都网站制作、成都网站建设经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先网站设计制作后付款的网站建设流程,更有临川免费网站建设让你可以放心的选择与我们合作。

text-decoration-line属性定义及用法

在css中,text-decoration-line属性是使用来规定文本修饰要使用的线条类型,如果需要同时设置text-decoration-line、text-decoration-style 和 text-decoration-color 属性的值,可以使用text-decoration属性。text-decoration属性可以将这三个属性定义在一个声明中。text-decoration-line属性支持多个属性值,比如使用underline和overline(text-decoration-line:underline overline;),在文本的上方和下方都显示线条.

text-decoration-line属性是css3中新增的属性,目前主流浏览器都还不支持该属性,但是Firefox浏览器支持另一个可替代该属性的属性(-moz-text-decoration-line属性)。

text-decoration-line属性语法格式

css语法:text-decoration-line: none/underline/overline/line-through/initial/inherit

JavaScript语法:object.style.textDecorationLine="overline"

属性值说明

none:默认值,规定文本修饰没有线条

underline :规定文本的下方将显示一条线

overline:规定文本的上方将显示一条线

line-through:规定文本的中间将显示一条线

initial:设置该属性为它的默认值

inherit:从父元素继承text-decoration-line属性的值

实例





css text-decoration-line属性文本修饰的线条类型



text-decoration-line属性演示1

text-decoration-line属性演示2

text-decoration-line属性演示3

text-decoration-line属性演示4

运行结果

css中text-decoration-line属性如何使用

关于css中text-decoration-line属性如何使用就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。


新闻名称:css中text-decoration-line属性如何使用-创新互联
URL标题:http://myzitong.com/article/dgcdpi.html