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: '1c' '1d'; }

Leave a Comment

Your email address will not be published.