每日一学—text-decoration 属性

 什么是text-decoration 属性❓

  text-decoration 属性是指规定添加到文本的修饰

  text-decoration 属性是以下三种属性的简写:

  • text-decoration-line
  • text-decoration-color
  • text-decoration-style

 text-decoration属性值

描述
none默认。定义标准的文本。
underline定义文本下的一条线。
overline定义文本上的一条线。
line-through定义穿过文本下的一条线。
blink定义闪烁的文本。
inherit规定应该从父元素继承 text-decoration 属性的值。

测试代码

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>text-decoration</title> 
<style>
h1.under {
    text-decoration: underline;
}
h1.over {
    text-decoration: overline;
}
p.line {
    text-decoration: line-through;
}
p.blink {
    text-decoration: blink;
}
a.none {
    text-decoration: none;
}
p.underover {
    text-decoration: underline overline;
}

</style>
</head>

<body>
<h1 class="under">下划线</h1>
<p class="line">删除线</p>
<p class="blink">闪烁效果,但浏览器不会显示</p>
<h1 class="over">下划线</h1>
<p>这是一个 <a class="none" href="#">链接</a>,默认情况下链接是有下划线的,这边我们移除它。</p>
<p class="underover">上划线与下划线</p>

</body>

</html>

实现效果

 


版权声明:本文为weixin_53231455原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。