text-decoration-skip-ink

CSS text-decoration-skip-ink Property

The text-decoration-skip-ink property specifies how underlines and overlines are drawn when they cross over a glyph.

When the text-decoration-line property is set to “underline” and “overline” the text-decoration-skip-ink property has an effect. “Line-through” value is unaffected.

类目类目
Initial Valueauto
Applies toAll elements.
InheritedYes.
AnimatableNo.
VersionCSS Text Decoration Module Level 4
DOM Syntaxobject.style.textDecorationSkipInk = “none”;

Syntax

Syntax

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

Example of the text-decoration-skip-ink property:

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</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 property example
    </h2>
    <h3>
        Text-decoration-skip-ink: none;
    </h3>
    <p class="ex1">
      Lorem ipsum is simply dummy text
    </p>
    <h3>
        Text-decoration-skip-ink:auto;
    </h3>
    <p class="ex2">
      Lorem ipsum is simply dummy text
    </p>
  </body>
</html>

Result

Values

Values

ValueDescription
autoUnderlines and overlines are only drawn where they do not touch or closely approach a glyph. This is the default value of this property.
noneUnderlines and overlines are drawn for all text content including parts that cross over glyph descenders and ascenders.
initialSets the property to its default value.
inheritInherits the property from its parent element.


请遵守《互联网环境法规》文明发言,欢迎讨论问题
扫码反馈

扫一扫,反馈当前页面

咨询反馈
扫码关注
返回顶部