Add double quotes to a paragraph with CSS

The quotes property in CSS allows you to set the type of quotation marks for quotations or any HTML elements. It defines which types of quotes are used when quotes are added with content: open-quote; and content: close-quote; rules.

Adding quotes to a paragraph can be done like this:

p {
  quotes: "“" "”" "‘" "’";
}
p::before {
    content: open-quote;
    font-size: 24px;
    color: red;
}
p::after {
    content: close-quote;
    font-size: 24px;
    color: red;
}

We can replace quote characters with unicode ones

p { quotes: '\201c' '\201d'; }

Leave a Comment

Your email address will not be published. Required fields are marked *

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close