quotes
CSS
property sets how the browser should render quotation marks that are added using the
open-quotes
or
close-quotes
values of the CSS
content
特性。
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
/* Keyword value */ quotes: none; quotes: auto; /* <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
open-quote
and
close-quote
values of the
content
property produce no quotation marks.
auto
lang
属性)。
[<string> <string>]+
<string>
values for
open-quote
and
close-quote
. The first pair represents the outer level of quotation, the second pair is for the first nested level, next pair for third level and so on.
| 初始值 | depends on user agent |
|---|---|
| 适用于 | 所有元素 |
| 继承 | yes |
| 计算值 | 如指定 |
| 动画类型 | discrete |
none | auto | [ <string> <string> ]+
<q>To be or not to be. That's the question!</q>
q {
quotes: '"' '"' "'" "'";
}
q::before {
content: open-quote;
}
q::after {
content: close-quote;
}
For most browsers, the default value of
quotes
is
auto
(Firefox 70+), or the browser otherwise had this default behavior (Chromiums, Safari, Edge), so this example works without it being explicitly being set.
<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;
}*/
| 规范 | 状态 | 注释 |
|---|---|---|
|
CSS Generated Content Module Level 3
The definition of 'quotes' in that specification. |
工作草案 | |
|
CSS Level 2 (Revision 1)
The definition of 'quotes' in that specification. |
推荐 | 初始定义 |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
quotes
|
Chrome 完整支持 11 | Edge 完整支持 12 | Firefox 完整支持 1.5 | IE 完整支持 8 | Opera 完整支持 4 | Safari 完整支持 9 | WebView Android 完整支持 37 | Chrome Android 完整支持 18 | Firefox Android 完整支持 4 | Opera Android 完整支持 14 | Safari iOS 完整支持 9 | Samsung Internet Android 完整支持 1.0 |
auto
keyword
|
Chrome
不支持
No
注意事项
|
Edge
不支持
No
注意事项
|
Firefox 完整支持 70 |
IE
不支持
No
注意事项
|
Opera
不支持
No
注意事项
|
Safari
不支持
No
注意事项
|
WebView Android
不支持
No
注意事项
|
Chrome Android
不支持
No
注意事项
|
Firefox Android 不支持 No |
Opera Android
不支持
No
注意事项
|
Safari iOS
不支持
No
注意事项
|
Samsung Internet Android
不支持
No
注意事项
|
完整支持
不支持
见实现注意事项。
content
quotes