{"id":14091,"date":"2011-09-05T21:02:00","date_gmt":"2011-09-06T04:02:00","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=14091"},"modified":"2020-02-29T06:55:39","modified_gmt":"2020-02-29T13:55:39","slug":"quotes","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/q\/quotes\/","title":{"rendered":"quotes"},"content":{"rendered":"

The quotes<\/code> property in CSS allows you to specify which types of quotes are used when quotes are added via the content: open-quote;<\/code> or content: close-quote;<\/code> rules. Here\u2019s how to use it:<\/p>\n

q {\r\n  quotes: \"\u201c\" \"\u201d\" \"\u2018\" \"\u2019\";\r\n}\r\nq::before {\r\n    content: open-quote;\r\n}\r\nq::after {\r\n    content: close-quote;\r\n}<\/code><\/pre>\n

In the example above, four values are added. A set of double smart quotes<\/a> and a pair of single smart quotes. It’s slightly confusing as each quote is wrapped in quotes – but those are just programmatic quotes (could be double (“) or single (‘)) as anywhere else in CSS. The quotes inside are what will be used on the page.<\/p>\n

There are four values for the content<\/a> property that relate to the quotes<\/code> property: open-quote<\/code>, close-quote<\/code>, no-open-quote<\/code>, and no-close-quote<\/code>.<\/p>\n

The first pair<\/strong> of quotes in the value are the opening and closing quotes. The second pair are the opening and closing quotes for quotes nested one level deep<\/em> within other quotes that also use the quotes<\/code> property. E.g. a <q><\/code> element inside of a <q><\/code> element.<\/p>\n

<\/figure>\n

A few examples:<\/p>\n

Double quotes on the first quote, single quotes on the second.<\/q><\/q><\/p>\n

A quote with French quotes.<\/q><\/p>\n

You can place as many pairs of quotes in the quotes<\/code> property as you like. But you don’t have to put more than two, because for every extra quote it simply repeats the quotes<\/code> values from the beginning.<\/p>\n

The no-open-quote<\/code> and no-close-quote<\/code> values stop the quotes from displaying, but they continue to increment the quote depth. <\/p>\n

More Information<\/h3>\n