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/quotes/index.html | 144 ++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 files/zh-cn/web/css/quotes/index.html (limited to 'files/zh-cn/web/css/quotes') diff --git a/files/zh-cn/web/css/quotes/index.html b/files/zh-cn/web/css/quotes/index.html new file mode 100644 index 0000000000..41d4290b70 --- /dev/null +++ b/files/zh-cn/web/css/quotes/index.html @@ -0,0 +1,144 @@ +--- +title: quotes +slug: Web/CSS/quotes +translation_of: Web/CSS/quotes +--- +
{{CSSRef}}
+ +
quotes CSS 属性用于设置引号的样式。
+ +
+ +
{{EmbedInteractiveExample("pages/css/quotes.html")}}
+ + + +

语法

+ +
/* Keyword value */
+quotes: none;
+
+/* <string> values */
+quotes: "«" "»";           /* Set open-quote and close-quote to the French quotation marks */
+quotes: "«" "»" "‹" "›";   /* Set two levels of quotation marks */
+
+/* Global values */
+quotes: inherit;
+quotes: initial;
+quotes: unset;
+
+ +

+ +
+
none
+
 {{cssxref("content")}} 属性的值 open-quote 和 close-quote 将不会展示引号.
+
auto
+
用适当的引号,基于在所选元素上设置的任何语言值(例如,通过 {{htmlattrxref("lang")}} 属性)。
+
[<string> <string>]+
+
一组或者多组 {{cssxref("<string>")}} 的值对应 open-quote and close-quote. 第一对表示引号的外层,第二对表示第一个嵌套层,下一对表示第三层,依此类推。
+
+ +

语法格式

+ +
{{csssyntax}}
+ +

示例

+ +

基本用法

+ +

HTML

+ +
<q>To be or not to be. That's the question!</q>
+
+ +

CSS

+ +
q {
+  quotes: '"' '"' "'" "'";
+}
+q::before {
+  content: open-quote;
+}
+q:after {
+  content: close-quote;
+}
+ +

结果

+ +

{{EmbedLiveSample('Basic_quote_marks', "100%", 60)}}

+ +

自动选择引号

+ +

HTML

+ +
<div lang="fr">
+  <q>Ceci est une citation française.</q>
+<div>
+<hr>
+<div lang="ru">
+  <q>Это русская цитата</q>
+<div>
+<hr>
+<div lang="de">
+  <q>Dies ist ein deutsches Zitat</q>
+<div>
+<hr>
+<div lang="en">
+  <q>This is an English quote.</q>
+<div>
+ +

CSS

+ +
/*q {
+  quotes: auto;
+}*/
+ +

结果

+ +

{{EmbedLiveSample('Auto_quotes', "100%", 200)}}

+ +

备注

+ + + +

规范

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("CSS3 Content", "#quotes", "quotes")}}{{Spec2("CSS3 Content")}}
{{ SpecName('CSS2.1', 'generate.html#quotes', 'quotes') }}{{ Spec2('CSS2.1') }}Initial definition
+ +

{{cssinfo}}

+ +

浏览器兼容性

+ + + +

{{Compat("css.properties.quotes")}}

+ +

参考

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