hanging-punctuation
CSS
property specifies whether a punctuation mark should hang at the start or end of a line of text. Hanging punctuation may be placed outside the line box.
/* Keyword values */ hanging-punctuation: none; hanging-punctuation: first; hanging-punctuation: last; hanging-punctuation: force-end; hanging-punctuation: allow-end; /* Two keywords */ hanging-punctuation: first force-end; hanging-punctuation: first allow-end; hanging-punctuation: first last; hanging-punctuation: last force-end; hanging-punctuation: last allow-end; /* Three keywords */ hanging-punctuation: first force-end last; hanging-punctuation: first allow-end last; /* Global values */ hanging-punctuation: inherit; hanging-punctuation: initial; hanging-punctuation: unset;
hanging-punctuation
property may be specified with one, two, or three values.
first
together with any one of
last
,
allow-end
,或
force-end
last
together with any one of
first
,
allow-end
,或
force-end
first
,
allow-end
,和
last
first
,
force-end
,和
last
none
No character hangs.
first
An opening bracket or quote at the start of the first formatted line of an element hangs.
last
A closing bracket or quote at the end of the last formatted line of an element hangs.
force-end
A stop or comma at the end of a line hangs.
allow-end
A stop or comma at the end of a line hangs if it does not otherwise fit prior to justification.
| 初始值 |
none
|
|---|---|
| 适用于 | 所有元素 |
| 继承 | yes |
| 计算值 | 如指定 |
| 动画类型 | discrete |
none | [ first || [ force-end | allow-end ] || last ]
<p>“Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur dignissim nunc mauris, et sollicitudin est scelerisque sed. Praesent laoreet tortor massa, sit amet vulputate nulla pharetra ut.”</p>
p {
hanging-punctuation: first last;
margin: .5rem;
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
CSS Text Module Level 3
The definition of 'hanging-punctuation' in that specification. |
工作草案 | 初始定义 |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
hanging-punctuation
|
Chrome 不支持 No | Edge 不支持 No | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No |
Safari
部分支持
10
注意事项
|
WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No |
Safari iOS
部分支持
10
注意事项
|
Samsung Internet Android 不支持 No |
部分支持
不支持
见实现注意事项。