css text-decoration属性
导读:CSS的text-decoration属性可以用来定义文本的装饰效果,例如下划线、删除线、上划线等。/* 下划线 */text-decoration: underline;/* 删除线 */text-decoration: line-thr...
CSS的text-decoration属性可以用来定义文本的装饰效果,例如下划线、删除线、上划线等。
/* 下划线 */text-decoration: underline; /* 删除线 */text-decoration: line-through; /* 上划线 */text-decoration: overline;
可以在同一个元素上同时使用多个text-decoration值,来组合出不同的效果。
/* 双下划线,红色 */text-decoration: underline double red; /* 红色波浪线 */text-decoration: overline wavy red; /* 红色虚线 */text-decoration: line-through dotted red;
除了text-decoration属性外,还有text-decoration-line、text-decoration-style、text-decoration-color等子属性,可以单独设置文本装饰的线条样式、效果、颜色。
/* 下划线,双线条 */text-decoration-line: underline; text-decoration-style: double; /* 删除线,虚线,绿色 */text-decoration-line: line-through; text-decoration-style: dotted; text-decoration-color: green;
需要注意的是,text-decoration属性对于一些特殊元素如超链接、段落等有默认的装饰效果,这些效果可以通过text-decoration:none来移除。
/* 移除超链接的下划线 */a { text-decoration: none; }
声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!
若转载请注明出处: css text-decoration属性
本文地址: https://pptw.com/jishu/340198.html