text-decoration-skip
CSS
property sets what parts of an element’s content any text decoration affecting the element must skip over.
It controls all text decoration lines drawn by the element and also any text decoration lines drawn by its ancestors.
注意:
Most other browsers are converging on supporting the simpler
text-decoration-skip-ink
特性。
/* Keyword values */ text-decoration-skip: none; text-decoration-skip: objects; text-decoration-skip: spaces; text-decoration-skip: edges; text-decoration-skip: box-decoration; /* Multiple keywords */ text-decoration-skip: objects spaces; text-decoration-skip: leading-spaces trailing-spaces; text-decoration-skip: objects edges box-decoration; /* Global values */ text-decoration-skip: inherit; text-decoration-skip: initial; text-decoration-skip: unset;
none
Nothing is skipped. Thus, text decoration is drawn for all text content and across atomic inline-level boxes.
对象
The entire margin box of the element is skipped if it is an atomic inline such as an image or inline-block.
spaces
letter-spacing
or
word-spacing
.
leading-spaces
spaces
, except that only leading spaces are skipped.
trailing-spaces
spaces
, except that only trailing spaces are skipped.
edges
The start and end of the text decoration is inset slightly (e.g., by half of the line thickness) from the content edge of the decorating box. Thus, adjacent elements receive separate underlines. (This is important in Chinese, where underlining is a form of punctuation.)
box-decoration
| 初始值 |
对象
|
|---|---|
| 适用于 | 所有元素 |
| 继承 | yes |
| 计算值 | 如指定 |
| 动画类型 | discrete |
none | [ objects || [ spaces | [ leading-spaces || trailing-spaces ] ] || edges || box-decoration ]
<p>Hey, grab a cup of <em>coffee!</em></p>
p {
margin: 0;
font-size: 3em;
text-decoration: underline;
text-decoration-skip: edges;
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
CSS Text Decoration Module Level 4
The definition of 'text-decoration-skip' in that specification. |
工作草案 | 初始定义 |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
text-decoration-skip
Experimental
|
Chrome
不支持
57 — 64
注意事项
|
Edge 不支持 No | Firefox 不支持 No | IE 不支持 No |
Opera
不支持
44 — 50
注意事项
|
Safari
完整支持
12.1
注意事项
|
WebView Android
不支持
57 — 64
注意事项
|
Chrome Android
不支持
57 — 64
注意事项
|
Firefox Android 不支持 No |
Opera Android
不支持
43 — 46
注意事项
|
Safari iOS
完整支持
12.2
注意事项
|
Samsung Internet Android
不支持
7.0 — 9.0
注意事项
|
完整支持
不支持
实验。期望将来行为有所改变。
见实现注意事项。
要求使用供应商前缀或不同名称。