CSS quotes Property

Beginner
6 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The quotes property sets which quotation mark strings the browser inserts for the HTML <q> element and for the open-quote / close-quote values of the content property.

Modern CSS uses auto for language-appropriate marks (via inherited lang). You can also set explicit string pairs for outer and nested levels, or use none to suppress marks. The property is inherited.

Baseline · Widely available.

Not deprecated. Standard-track CSS. Pair it with semantic <q>, or with ::before / ::after and content: open-quote / close-quote. Not a runtime API.

CSS Syntax

syntax.css
quotes: auto | none | [<string> <string>]+ | initial | inherit;

Property Values

ValueDescriptionTry it
autoLanguage-appropriate quotation marks (via inherited lang)Try it
noneNo quotation marks from q or open/close-quoteTry it
"«" "»One open/close string pair (outer level)Try it
"“" "”" "‘" "’"Two pairs: outer then nested levelTry it
With contentUse open-quote / close-quote on pseudo-elementsTry it
initialResets to the property’s initial valueTry it
inheritTakes the value from the parent elementTry it

How to Use quotes

Decide the mark strings, then let <q> or generated content insert them.

  1. Set quotes on an ancestor (it is inherited) or on the quoted element itself.
  2. Use a semantic <q> for inline quotations, or nest <q> for deeper levels.
  3. Optionally add more string pairs for nested levels: outer first, then inner.
  4. For non-q elements, set content: open-quote and close-quote on ::before / ::after.
PieceRequired?Role
quotes valueYesChooses auto, none, or string pairs
<q> or open/close-quoteYesSomething must request quotation marks
Nested pairsOptionalDifferent marks for nested levels
langFor autoLanguage of surrounding text guides auto marks

Live Preview

Nested <q> elements pick marks from quotes. Change the value and watch outer and inner marks update.

Outer and nested <q> marks come from the current quotes value.

Quote

She said practice every day and smiled.

quotes: “ ” ‘ ’

CSS Examples

Each snippet focuses on quotes. Extra layout CSS is kept minimal. Use Try It Yourself for a live editor.

Example 1 — Nested Quote Pairs

Give the outer quote curly doubles and the nested quote curly singles.

CSS
<style>
  q {
    quotes: "\201C" "\201D" "\2018" "\2019";
  }
</style>

<p>
  <q>She said <q>practice every day</q> and smiled.</q>
</p>
Try It Yourself

How It Works

  1. List two pairs. First open/close is the outer level; second is the nested level.
  2. Use a nested <q>. Nesting depth picks which pair the browser inserts.
  3. Unicode escapes are optional. "\201C" is the same as typing “ in the stylesheet.
  4. Marks are automatic. You do not type the quote characters in the HTML text.

Example 2 — Suppress Quotation Marks

Turn off automatic marks when you want plain text inside <q>.

CSS
<style>
  q {
    quotes: none;
  }
</style>

<p>
  <q>Quoted text with no marks.</q>
</p>
Try It Yourself

How It Works

  1. Keep the semantic element. <q> still marks a quotation in HTML.
  2. Set quotes to none. The browser inserts no open or close marks.
  3. Same for content. open-quote / close-quote also produce nothing under none.
  4. Use when styling yourself. Handy if icons or borders replace typographic quotes.

Example 3 — Quotes via Generated Content

Apply quotes to a class, then insert marks with ::before and ::after.

CSS
<style>
  .quote {
    quotes: "«" "»";
  }
  .quote::before {
    content: open-quote;
  }
  .quote::after {
    content: close-quote;
  }
</style>

<p>
  <span class="quote">Bonjour</span>
</p>
Try It Yourself

How It Works

  1. Set the pair on the element. quotes: "«" "» defines open and close strings.
  2. Request open-quote. ::before { content: open-quote; } inserts the first string.
  3. Request close-quote. ::after { content: close-quote; } inserts the second string.
  4. Prefer <q> when possible. Generated content is useful when you cannot use <q>.

Edge Cases & Pitfalls

If the wrong marks appear, one of these is usually why.

pairs

Values come in open/close pairs

Always provide strings in pairs. A single string alone is invalid. Deeper nesting repeats the last pair when you run out of pairs.

lang

auto follows surrounding language

Put lang on an ancestor of the quote for the language of the surrounding text. Customary typography quotes the text with marks of the surrounding language, not necessarily the quote’s own language.

inherit

quotes is inherited

Setting it on a parent affects nested <q> elements. Override on a child only when that subtree needs different marks.

content

no-open-quote still changes depth

content: no-open-quote / no-close-quote change nesting depth without inserting marks. Useful for multi-paragraph quotations.

typing

Do not hard-code marks in HTML text

If you type “...” inside <q>, you get double marks. Let quotes (or generated content) insert them.

Browser Support

quotes is a browser CSS property for quotation mark strings. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

quotes

Widely supported across modern browsers. String pairs work in long-standing engines including Internet Explorer. auto is the modern language-aware keyword.

97% Core support
Google Chrome All modern
Full support
Mozilla Firefox All modern
Full support
Apple Safari All modern
Full support
Microsoft Edge All modern
Full support
Opera Modern
Full support
Samsung Internet All modern
Full support
Internet Explorer 8+ (pairs)
Partial
quotes Widely supported

Bottom line: Safe to teach and ship for string pairs and none. Prefer auto for language-aware defaults in modern browsers. It is not a runtime API.

Key Takeaways

  • Role: choose which strings become automatic quotation marks.
  • auto vs pairs: auto follows language; string pairs override with exact marks.
  • Nesting: first pair is outer; next pairs are deeper levels.
  • Hooks: works with <q> and with content: open-quote / close-quote.

One line: set quote string pairs (or auto), then let <q> or open/close-quote insert the marks — do not type them twice in HTML.

Frequently Asked Questions

It sets which quotation mark strings the browser uses for the HTML q element and for the open-quote and close-quote values of the content property, including nested quote levels.
Modern CSS treats auto as the language-appropriate default: the browser picks marks based on the inherited language (for example via the lang attribute). The formal initial value can depend on the user agent.
List open-close string pairs in order. The first pair is the outer level, the second is the first nested level, and so on. If nesting goes deeper than the list, the last pair repeats.
none makes open-quote and close-quote insert no marks (as if no-open-quote and no-close-quote). Automatic marks on q are also suppressed.
The q element inserts marks by itself using quotes. For other elements, set quotes and use ::before / ::after with content: open-quote and content: close-quote.
quotes is Baseline Widely available across modern browsers and has long support in Internet Explorer for string pairs. It is a browser CSS property, not a Node.js feature.

Next: resize

Learn how to let users resize elements with the CSS resize property.

resize tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful