CSS text-decoration-skip-ink 属性

text-decoration-skip-ink 属性指定下划线和上划线在跨越字形时如何绘制。

当 text-decoration-line 属性设置为“underline”和“overline”时,text-decoration-skip-ink 属性会起作用。

“线路通过”值不受影响。

初始值auto
应用于所有元素。
继承可继承
可动画的无效
版本CSS文本装饰模块等级4
DOM 语法object.style.textdecorationskipink =“none”;

语法

text-decoration-skip-ink: auto | none | initial | inherit;

text-decoration-skip-ink 属性示例:

<!DOCTYPE html>
<html>
  <head>
    <title>文档的标题</title>
    <style>
      .ex1 {
        margin: 0;
        font-size: 2em;
        text-decoration: underline #1c87c9;
        text-decoration-skip-ink: none;
      }
      .ex2 {
        margin: 0;
        font-size: 2em;
        text-decoration: underline #1c87c9;
        text-decoration-skip-ink: auto;
      }
    </style>
  </head>
  <body>
    <h2>
        Text-decoration-skip-ink 属性示例
    </h2>
    <h3>
        Text-decoration-skip-ink: none;
    </h3>
    <p class="ex1">
      生活终归还得继续。
    </p>
    <h3>
        Text-decoration-skip-ink:auto;
    </h3>
    <p class="ex2">
      生活终归还得继续。
    </p>
  </body>
</html>

CSS text-decoration-skip-ink 属性值说明

描述
auto强调和重叠仅绘制他们不触摸或者密切接近字形的地方。这是此属性的默认值。
none为所有文本内容绘制强调和重叠,包括交叉字体解除仪和升级的部分。
initial将属性设置为默认值。
inherit从其父元素继承属性。
日期:2020-06-02 22:14:48 来源:oir作者:oir