CSS Reference ยท Typography
The quotes property
Reference for the CSS quotes property: choose the quotation marks used by the q element and open-quote and close-quote, with nesting levels and a live example.
The quotes property defines the quotation marks that browsers insert around quoted content. It affects the HTML <q> element and any generated content that uses the open-quote and close-quote keywords of the content property.
You give pairs of strings: the first pair is for the outermost quote, the second pair for a quote nested inside it, and so on. That lets you follow the typographic rules of a language, for example guillemets in French or low-high quotes in German.
q { quotes: "ยซ" "ยป" "โน" "โบ"; }
Try it
Each paragraph styles the same markup differently: the outer <q> uses the first pair, the inner one uses the second pair, and none removes the marks entirely.
Syntax
quotes: auto | none | match-parent | [ <string> <string> ]+;
| Initial value | depends on the user agent (usually quotation marks for the content's language) |
| Applies to | all elements |
| Inherited | yes |
| Animatable | no |
| Computed value | as specified |
Values
| Value | Description |
|---|---|
auto |
The browser picks marks that suit the language set by lang on the element or its ancestors. |
none |
open-quote and close-quote produce nothing. |
match-parent |
Takes the quote pairs of the parent element, so nested quotes continue the same set. Mainly used by browsers' default styles. |
<string> <string> |
One or more pairs: opening mark then closing mark. The first pair is for depth 1, the second for depth 2, and so on. If nesting goes deeper than the pairs given, the last pair is reused. |
Usage notes
<q>andcontent. The browser's built-in style forq::beforeiscontent: open-quoteandq::afteriscontent: close-quote. Because of that, thequotesproperty affects<q>without extra rules. For other elements, add thecontentyourself, as inblockquote p::before { content: open-quote; }.- Set
lang. With the defaults, quotation style depends on the document language, so<html lang="fr">produces French quotes without any CSS. Customquotesis only needed when you want something different. - Nested depth is counted per element tree. Depth increases for each open quote that is not yet closed, including quotes from
content. no-open-quoteandno-close-quotekeywords forcontentchange the depth without printing a mark, useful for quotes that continue across paragraphs.- The marks are generated. They are not selectable or searchable. If the quote marks must be copied with the text, put them in the HTML.
- Screen readers may or may not read generated quote marks.
Browser support
Supported in every browser.
Related
contentโ theopen-quoteandclose-quotekeywords::beforeโ where quote marks are generatedhanging-punctuationโ let quote marks sit outside the text edge- Lesson: Pseudo-elements