CSS quotes 属性
CSS quotes 属性用于设置引号的样式。
实例
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang="en"><head><style type="text/css">q:lang(en){quotes: '"' '"' "'" "'"}</style></head><body><p><q>This is a <q>big</q> quote.</q></p><p><b>注释:</b>如果已规定 !DOCTYPE,那么 Internet Explorer 8 (以及更高版本)支持 quotes 属性。</p></body></html>
浏览器支持
表格中的数字注明了完全支持该属性的首个浏览器版本。
| 属性 | |||||
|---|---|---|---|---|---|
| quotes | 11.0 | 8.0 | 1.5 | 5.1 | 4.0 |
注释:如果已规定 !DOCTYPE,那么 Internet Explorer 8 (以及更高版本)支持 quotes 属性。
定义和用法
quotes 属性设置嵌套引用(embedded quotation)的引号类型。
| 默认值: | not specified |
|---|---|
| 继承性: | yes |
| 版本: | CSS2 |
| JavaScript 语法: | object.style.quotes="none" |
可能的值
| 值 | 描述 |
|---|---|
| none | 规定 "content" 属性的 "open-quote" 和 "close-quote" 的值不会产生任何引号。 |
| string string string string | 定义要使用的引号。 前两个值规定第一级引用嵌套,后两个值规定下一级引号嵌套。 |
| inherit | 规定应该从父元素继承 quotes 属性的值。 |
引号字符
| 结果 | 描述 | 实体数值 |
|---|---|---|
| “ | 双引号 | \0022 |
| ‘ | 单引号 | \0027 |
| ‹ | 单左角引号 | \2039 |
| › | 单右角引号 | \203A |
| « | 双左角引号 | \00AB |
| » | 双右角引号 | \00BB |
| ‘ | 左引号 (single high-6) | \2018 |
| ’ | 右引号 (single high-9) | \2019 |
| “ | 左引号 (double high-6) | \201C |
| ” | 右引号 (double high-9) | \201D |
| „ | 双引号 (double low-9) | \201E |