CSS quotes Property

Beginner
⏱️ 6 min read
📚 Updated: Jun 2026
🎯 4 Examples
Typography

What You’ll Learn

The quotes property lets you choose quotation mark characters for nested text. It works with the content property and keywords open-quote and close-quote.

01

auto

Language default.

02

none

No quotes.

03

Pairs

Custom marks.

04

Nested

Multiple levels.

05

content

open/close-quote.

06

<q>

Inline quotes.

Introduction

The quotes property in CSS is used to define the type of quotation marks to be used for the content property in pseudo-elements like ::before and ::after.

This property allows you to specify which quotation marks should be used for nested quotations, providing greater control over the typography and style of your text content.

Definition and Usage

Browsers can add quote marks to the <q> element automatically, but custom typography often needs curly quotes, guillemets, or other regional styles.

Set quotes on a container such as blockquote, then insert marks with content: open-quote and content: close-quote on pseudo-elements or nested <q> tags.

💡
Beginner Tip

quotes only defines the characters. You still need content: open-quote or close-quote (or a <q> element) to display them.

📝 Syntax

The syntax for the quotes property involves specifying a list of pairs of opening and closing quotes.

syntax.css
element {
  quotes: none | auto | [open-quote close-quote]+;
}

Basic Example

quotes-blockquote.css
blockquote {
  quotes: "\201C" "\201D" "\2018" "\2019";
}

blockquote::before { content: open-quote; }
blockquote::after { content: close-quote; }

Syntax Rules

  • Each pair is one open string followed by one close string.
  • The first pair applies to the outermost quotation level.
  • Additional pairs apply to deeper nested quotes.
  • none turns off quote generation for that element.
  • auto uses language-appropriate marks from the browser.
  • Use with ::before, ::after, or <q> pseudo-elements.

🎯 Default Value

The default value of the quotes property is dependent on the browser’s default settings, which typically use standard quotation marks for the language of the document.

In CSS, the initial value is auto, so quote characters usually follow the document language unless you override them.

⚡ Quick Reference

QuestionAnswer
Default valueauto (language-dependent)
Disable quotesquotes: none;
Insert markscontent: open-quote; / close-quote
InheritedYes
AnimatableNo
Common useBlockquotes, pull quotes, nested inline quotations

💎 Property Values

ValueExampleDescription
autoquotes: auto;Uses quotation marks appropriate to the document language.
nonequotes: none;No quotes will be used.
[open close]+quotes: "\201C" "\201D" "\2018" "\2019";Specifies pairs of opening and closing quotes for different levels of quotation.
auto none "\201C" "\201D" open-quote close-quote

When Does quotes Matter?

quotes is the right tool when quotation typography should be consistent:

  • Editorial sites — Match print-style curly quotes on pull quotes.
  • Nested dialogue — Switch to single quotes inside double quotes automatically.
  • Localized content — Use guillemets or other regional quote styles.
  • Minimal UI — Remove default <q> marks with none.

For body text, good typography often beats hard-coded quote characters typed into HTML.

👀 Live Preview

Outer quotes use “ ” and nested <q> uses ‘ ’ via two quote pairs.

Good typography respects quotation hierarchy. Nested quotes should look different from the outer quote.

Examples Gallery

Start with the reference blockquote, disable quotes, try guillemets, and build a pull quote with pseudo-elements.

📝 Custom Quotation Marks

Define quote pairs and display them with open-quote and close-quote — matching the reference example.

Example 1 — Blockquote with Custom Quotes

In this example, we’ll define custom quotes for blockquotes and nested quotes.

quotes-blockquote.html
<style>
  blockquote {
    quotes: "\201C" "\201D" "\2018" "\2019";
  }
  blockquote::before { content: open-quote; }
  blockquote::after { content: close-quote; }
  blockquote q::before { content: open-quote; }
  blockquote q::after { content: close-quote; }
</style>

<blockquote>
  This is a blockquote with custom quotes.
  <q>This is a nested quote within the blockquote.</q>
</blockquote>
Try It Yourself

How It Works

The first quote pair styles the blockquote. The second pair is used automatically when a nested <q> appears inside it.

Example 2 — quotes: none

Disable automatic quotation marks when you want plain text or custom icons instead of quote characters.

quotes-none.html
<style>
  .no-quotes {
    quotes: none;
  }
  .no-quotes q::before,
  .no-quotes q::after {
    content: none;
  }
</style>
Try It Yourself

How It Works

quotes: none stops quote generation. Remove any existing <q> pseudo-element content to fully hide marks.

🌐 Regional & Decorative Styles

Use different character pairs for editorial or localized typography.

Example 3 — Guillemet Quote Style

Use « » for the outer quote and single curly quotes for nested text.

quotes-guillemets.html
<style>
  blockquote {
    quotes: "\00AB" "\00BB" "\2018" "\2019";
  }
</style>
Try It Yourself

How It Works

Unicode escape sequences let you use precise characters regardless of keyboard layout.

Example 4 — Pull Quote with Pseudo-Elements

Place a large opening quote with ::before and close the sentence with ::after.

quotes-pseudo.html
<style>
  .pull-quote {
    quotes: "\201C" "\201D";
    position: relative;
  }
  .pull-quote::before {
    content: open-quote;
    position: absolute;
    left: 0;
    font-size: 2.5rem;
  }
</style>
Try It Yourself

How It Works

open-quote pulls the first character from the quotes list, so you can style it separately from the body text.

quotes and the content property

quotes defines the characters. The content property inserts them using open-quote and close-quote on ::before and ::after.

Pair with semantic HTML such as <blockquote> and <q> so assistive technologies understand quoted material.

quotes-with-content.css
q {
  quotes: "\201C" "\201D" "\2018" "\2019";
}

q::before { content: open-quote; }
q::after { content: close-quote; }

🧠 How quotes Works

1

Define quote pairs

Set quotes on a container with one or more open-close pairs.

quotes
2

Request open or close marks

Use content: open-quote or close-quote in CSS.

content
3

Nesting picks the next pair

Deeper nested quotes automatically use the next pair in the list.

Nesting
=

Polished typography

Consistent, nest-aware quotation marks without typing every character by hand.

Browser Compatibility

The quotes property is supported in most modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. However, it is always a good practice to test your website across different browsers to ensure compatibility.

Typography · Broad support

Reliable quotes support

Chrome, Firefox, Safari, Edge, and Opera support quotes with open-quote and close-quote.

97% Modern browser support
Google Chrome 1+ · Desktop & Mobile
Full support
Mozilla Firefox 1.5+ · Desktop & Mobile
Full support
Apple Safari 1+ · macOS & iOS
Full support
Microsoft Edge 12+ · All versions
Full support
Opera 4+ · Modern versions
Full support

Testing tip

Verify nested <q> elements in Safari and Firefox if you rely on more than two quote levels.

quotes property 97% supported

Bottom line: quotes is safe for custom blockquote and inline quote typography in modern browsers.

Conclusion

The quotes property in CSS is a useful tool for controlling the appearance of quotation marks in your web content.

By defining custom quotes, you can enhance the readability and aesthetic appeal of your text, especially when dealing with nested quotations. Experiment with different styles and see how this property can improve the typography of your web projects.

💡 Best Practices

✅ Do

  • Use semantic <blockquote> and <q> elements
  • Provide two pairs for double-then-single nested quotes
  • Use Unicode escapes for precise curly or guillemet characters
  • Pair quotes with content: open-quote / close-quote
  • Match quote style to the document language and tone

❌ Don’t

  • Type decorative quotes directly into HTML when CSS can manage nesting
  • Forget pseudo-elements when custom marks do not appear
  • Use straight keyboard quotes when curly quotes are expected
  • Assume quotes alone adds visible marks without content
  • Remove quotes without checking screen reader semantics

Key Takeaways

Knowledge Unlocked

Five things to remember about quotes

Use these points when styling quotation marks.

5
Core concepts
02

Pairs

Custom chars.

Pattern
03

Nesting

Level by level.

Use case
04

content

open/close-quote.

Companion
05

none

Disable marks.

Option

❓ Frequently Asked Questions

quotes defines which quotation mark characters are used for open-quote and close-quote in the content property. It also controls quote marks on nested quotations when used with the q element or pseudo-elements.
Set quotes on the element, then use ::before { content: open-quote; } and ::after { content: close-quote; }. The browser inserts the correct pair for each nesting level.
The initial value is auto, which uses quotation marks appropriate to the document language. Browsers may also apply language-specific defaults.
quotes: none disables automatic quotation marks. Paired with content: none on q pseudo-elements, it removes quote characters entirely.
Yes. Provide multiple open-close pairs in one declaration. The first pair is for the outer quote, the second for the next nested level, and so on.

Practice in the Live Editor

Open the HTML editor and build a blockquote with nested <q> elements and custom quote pairs.

HTML Editor →

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.

5 people found this page helpful