text-decoration-skip

CSS text-decoration-skip Property

The text-decoration-skip property specifies the parts of an element’s content the text decoration should skip over.

It controls all text decoration lines drawn by the element and by its ancestors.

The “ink” value was moved to the text-decoration-skip-ink property.

类目类目
Initial Valueobjects
Applies toAll elements.
InheritedYes.
AnimatableNo.
VersionCSS3
DOM Syntaxobject.style.textDecorationSkip = “spaces”;

Syntax

Syntax

text-decoration-skip: none | objects | spaces | leading spaces | trailing spaces | edges | box-decoration | initial | inherit;

Example of the text-decoration-skip property:

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      p {
        margin: 1;
        color: #ccc;
        font-size: 2em;
        text-decoration: underline;
        text-decoration-skip: edges;
      }
    </style>
  </head>
  <body>
    <h2>Text-decoration-style property example</h2>
    <p>
      <em>Lorem,</em>
      <em>ipsum is simply dummy text</em>
    </p>
  </body>
</html>

Result

Values

Values

ValueDescription
noneNo skip will appear. Thus, text decoration is drawn for all text content.
objectsThe entire margin box of the element is skipped if it is an image or inline-block.
spacesAll spacing is skipped.
leading spacesLeading spaces are skipped (typographic character units, word separators, letter-spacing or word-spacing).
trailing spacesTrailing spaces are skipped (typographic character units, word separators, letter-spacing or word-spacing).
edgesThe start and end of the text decoration is inset slightly from the content edge of the decorating box.
box-decorationThe box’s margin, border, and padding areas are skipped.
inkGlyphs or descenders are skipped.
initialSets the property to its default value.
inheritInherits the property from its parent element.


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

扫一扫,反馈当前页面

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