CSS Properties: How to set the content to be a closing quote?
Solution:
HTML Code:
Explanation:
- This HTML document demonstrates how to use the content property in CSS to insert opening and closing quotes before and after the content of selected elements.
- The CSS rule p:before selects the pseudo-element ::before of all <p> elements and inserts an opening quote using content: open-quote;.
- The CSS rule p:after selects the pseudo-element ::after of all <p> elements and inserts a closing quote using content: close-quote;.
- In this example, opening and closing quotes are added before and after the content of each <p> element, respectively.
Live Demo
See the solution in the browser
Supported browser
![]() |
![]() |
![]() |
![]() |
![]() |
Yes | Yes | Yes | Yes | Yes |
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.