目录

CSS hanging-punctuation 属性


示例

将标点符号(如果有)放置在 <p> 元素中第一行的起始边缘之外:

p {
  hanging-punctuation: first;
}

定义和用法

这个hanging-punctuation属性指定标点符号是否可以放置在整行文本开头或结尾的行框之外。

默认值: 没有任何
遗传: 是的
可动画: 不。阅读可动画的
版本: CSS3
JavaScript 语法: 对象.style.hangingPunctuation="first"

浏览器支持

主流浏览器都不支持悬挂标点属性。

Property
hanging-punctuation Not supported Not supported Not supported 10+ Not supported


CSS 语法

hanging-punctuation: none|first|last|allow-end|force-end|initial|inherit;

属性值

Value Description
none No punctuation mark may be placed outside the line box at the start or at the end of a full line of text
first Punctuation may hang outside the start edge of the first line
last Punctuation may hang outside the end edge of the last line
allow-end Punctuation may hang outside the end edge of all lines if the punctuation does not otherwise fit prior to justification
force-end Punctuation may hang outside the end edge of all lines. If justification is enabled on this line, then it will force the punctuation to hang
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit