请选择 进入手机版 | 继续访问电脑版

css中text-decoration 属性使用方法教程

[复制链接]
查看3652 | 回复1 | 2019-7-22 07:17 | 显示全部楼层 |阅读模式
css中text-decoration 属性使用方法教程
语法:
text-decoration : none || underline || blink || overline || line-through
取值:
none : 默认值。无装饰
blink : 闪烁
underline : 下划线
line-through : 贯穿线
overline : 上划线
说明:
检索或设置对象中的文本的装饰。
有 href 特性的 a ,以及 u , ins 对象默认值为 underline 。
对象 strike , s , del ,默认值是 line-through 。
假如 none 值在属性声明的最后,所有的先前的其他取值都会被清除。例如,声明 text-decoration: underline overline blink none 等于声明 text-decoration: none 。
假如对象没有文本(如 img 元素)或者是空元素(如:<EM></EM>), 此属性不会发生作用。
假如你设置 body 对象的此属性值为 none , a 对象将依然保持其原有的下划线样式。除非你针对 a 对象声明此属性值。
指定块对象的此属性将影响其所有内联子对象。而此影响一旦发生,块对象容器最终会受到影响。
在IE4+中可用的值为 overline 和 blink 。虽然 blink 值被提供,但它不会被作用。
此属性对于 currentStyle 对象而言是只读的。对于其他对象而言是可读写的。
对应的脚本特性为 textDecoration 。



案例:
  1. <html>
  2. <head>
  3. <style type="text/css">
  4. h1 {text-decoration: overline}
  5. h2 {text-decoration: line-through}
  6. h3 {text-decoration: underline}
  7. h4 {text-decoration:blink}
  8. a {text-decoration: none}
  9. </style>
  10. </head>

  11. <body>
  12. <h1>这是标题 1</h1>
  13. <h2>这是标题 2</h2>
  14. <h3>这是标题 3</h3>
  15. <h4>这是标题 4</h4>
  16. <p><a href="http://www.w3school.com.cn/index.html">这是一个链接</a></p>
  17. </body>
  18. </html>
复制代码
效果如下:

css中text-decoration 属性使用方法教程

css中text-decoration 属性使用方法教程

178 | 2019-8-20 05:10 | 显示全部楼层
技术学习教程网,支持一下。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

UID
1
贡献
387
丢币
38902
主题
4607
回帖
116
注册时间
2018-9-25
最后登录
2024-3-24