7.3. CSS text-decoration 属性

text-decoration属性是CSS2.1提出的.IE6,Firefox1.5,Opera9支持此属性IE6不支持blink属性
text-decoration -- 定义文本是否有划线以及划线的方式
  • 取值:none | [ underline || overline || line-through || blink ] | inherit
    • none: 定义正常显示的文本
    • [underline || overline || line-through || blink]: 四个值中的一个或多个
      • underline: 定义有下划线的文本
      • overline: 定义有上划线的文本
      • line-through: 定义直线穿过文本
      • blink: 定义闪烁的文本
    • inherit: 继承
  • 初始值: none
  • 继承性: 否
  • 适用于: 所有元素
  • text:文本.decoration:装饰.
  • 引用网址:http://www.dreamdu.com/css/property_text_decoration/

示例

p#underline
{
	text-decoration:underline;
}

p#overline
{
	text-decoration:overline;
}

p#line-through
{
	text-decoration:line-through;
}

p#blink
{
	text-decoration:blink;
}

p#underover
{
	text-decoration:underline overline;
}

p#underoverthroughblink
{
	text-decoration:underline overline line-through blink;
}

css text-decoration 属性示例

说明:

  • HTML的u标签定义下划线样式的文字,s标签strike标签定义了删除线样式的文字,此标签已经被w3c抛弃.

延伸阅读

参考

向上 / / / 教程列表