text-decoration 属性规定添加到文本的修饰。
text-decoration:none|underline|overline|line-through|blink|inherit;
| 值 | 描述 |
| none | 默认。定义标准的文本。 |
| underline | 定义文本下的一条线。 |
| overline | 定义文本上的一条线。 |
| line-through | 定义穿过文本下的一条线。 |
| inherit | 规定应该从父元素继承 text-decoration 属性的值。 |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>零基础入门学习前端</title>
<style>
h1 {text-decoration:overline;}
h2 {text-decoration:line-through;}
h3 {text-decoration:underline;}
</style>
</head>
<body>
<h1>eagleslab.com</h1>
<h2>eagleslab.com</h2>
<h3>eagleslab.com</h3>
</body>
</html>
表格中的数字表示支持该属性的第一个浏览器版本号。
| Safari | Chrome | FireFox | IE |
| 1.0 | 1.0 | 1.0 | 3.0 |