From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/css/hanging-punctuation/index.html | 99 ++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 files/zh-cn/web/css/hanging-punctuation/index.html (limited to 'files/zh-cn/web/css/hanging-punctuation/index.html') diff --git a/files/zh-cn/web/css/hanging-punctuation/index.html b/files/zh-cn/web/css/hanging-punctuation/index.html new file mode 100644 index 0000000000..b7d28f226f --- /dev/null +++ b/files/zh-cn/web/css/hanging-punctuation/index.html @@ -0,0 +1,99 @@ +--- +title: hanging-punctuation +slug: Web/CSS/hanging-punctuation +tags: + - css css属性 css文本 +translation_of: Web/CSS/hanging-punctuation +--- +
{{cssref}}
+ +
hanging-punctuation CSS属性指定了标点符号应该放在文本句子的开头还是结尾。悬挂标点符号可能被放在线框外。
+ +
+ +
/* 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;
+
+ +

{{cssinfo}}

+ +

语法

+ +

这个属性可被指定多个值,可以是一个值,也可以是两个值,或者是三个值。

+ + + +

取值

+ +
+
none
+
无悬挂字符。
+
first
+
显示元素的第一个格式化行开头的括号或引号。
+
last
+
显示元素的最后一个格式化行结尾的括号或引号。
+
force-end
+
显示行结尾处的句号或逗号。
+
allow-end
+
如果预先没有其它适合的来适应的,则在行尾显示句号或逗号。
+
+ +

正式语法

+ +
{{csssyntax}}
+ +

示例

+ +

HTML

+ +
<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>
+ +

CSS

+ +
p {
+  hanging-punctuation: first;
+  margin: .5rem;
+}
+ +

Result

+ +

Specifications

+ + -- cgit v1.2.3-54-g00ecf