--- title: quotes slug: Web/CSS/quotes translation_of: Web/CSS/quotes ---
quotes CSS 属性用于设置引号的样式。/* 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;
noneopen-quote 和 close-quote 将不会展示引号.auto[<string> <string>]+open-quote and close-quote. 第一对表示引号的外层,第二对表示第一个嵌套层,下一对表示第三层,依此类推。<q>To be or not to be. That's the question!</q>
q {
quotes: '"' '"' "'" "'";
}
q::before {
content: open-quote;
}
q:after {
content: close-quote;
}
{{EmbedLiveSample('Basic_quote_marks', "100%", 60)}}
<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>
/*q {
quotes: auto;
}*/
{{EmbedLiveSample('Auto_quotes', "100%", 200)}}
-moz-initial读取quotes属性的初始值,这在Firefox的早期版本中是不可能的。| Specification | Status | Comment |
|---|---|---|
| {{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")}}