Add Double Quotes to a Paragraph with CSS

CSS provides a means of specifying how text should be quoted. The quote property can be used to set the type of quotation marks used, as well as the angle at which they are displayed.

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>CSS (Cascading Style Sheets) is a style sheet language used for describing the presentation of a document written in a markup language. A style sheet is a collection of rules that tells a web browser how to display a document written in HTML or XML.</p>
<style type="text/css">
  p {
  quotes: "“" "”" "‘" "’";
}
p::before {
    content: open-quote;
    font-size: 24px;
    color: red;
}
p::after {
    content: close-quote;
    font-size: 24px;
    color: red;
}
  </style>

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 *


Scroll to Top

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