English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS Reference Manual

CSS @rules

Complete List of CSS Properties

CSS quotes attribute usage and examples

quotes CSS属性指定嵌入式的引号。为此属性指定的引号字符用于contentThe quotes CSS attribute specifies embedded quotes. The quote characters specified for this attribute are used for

The beginning quote and ending quote of the attribute.

The following table provides usage instructions and version history of this attribute, as well as the syntax of its use in JavaScript scripts.none
Default value:Applicable to:
All elementsInheritance:
YesCan be animated:No. Please see.
Animation propertiesCSS 2Version:3
,object.style.quotes="none"

The syntax of the use of quotes

The syntax of this attribute is as follows:

quotes: [string string] one or more pairs | none | initial | inherit

The following examples demonstrate how to use the quotes attribute.

  q {
   quotes: '['']''''';
  }
  q:before {
   content: open-quote;
  }
  q:after {
   content: close-quote;
  }
Test and see‹/›

Attribute value

The following table describes the value of this attribute.

ValueDescription
nonecontentopen attribute-quote and close-quote values do not produce quotes. This is the default value.
[string string]Define one or more pairs of string values for open-quote and close-quote. The first pair represents the external horizontal of the quote; the second pair represents the external horizontal. The second pair is used for the first level of nesting, the second pair is used for the third level, and so on.
initialSet this attribute to its default value.
inheritIf specified, the associated elements adopt the attribute value of quotes of its parent element.

Browser compatibility

Browser compatibility of the quotes attribute, the numbers in the following table indicate the minimum version number of the browsers that support this attribute; all mainstream browsers support this attribute.

  • Firefox 1.5Above

  • Google Chrome11+

  • Internet Explorer 8+

  • Apple Safari (none)

  • Opera 7+

Warning: Internet Explorer 7and earlier versions do not support the quotes attribute. IE8Supports this attribute, but requires an effective<!DOCTYPE>.

Further reading

Please refer to the following tutorials:CSS pseudo-elements.

Related properties:content.