1

I'm designing a template for my wordpress and I want to introduce some style for the blockquote tag.

As writing and all the time could be a little messy, I wonder if I can style the :before and :after elements of the quote to make it simpler. Of course I know this is possible and how to do it but I don't know if it is html5 friendly.

So, must the quotemarks be in the html or can they be included with css?

4

1 Answer 1

2

The quotation marks can safely be included in the CSS without violating any HTML5 best practices.

First, browsers normally don't display quotation marks when rendering the <blockquote> element. Chrome, Firefox and IE10 apply indentation to blockquotes by default. So it's not like you're removing quote marks that are normally there by putting them in the CSS.

Second, you mentioned the word "style" in your question a couple of times. That's a good hint at where the quotation marks should go.

Third, the ::before and ::after pseudo-elements are specifically designed for adding cosmetic content, like quotation marks. In fact, if you read the MDN page for ::before you'll find that their primary use-case example is precisely about adding quotation marks.

1

Not the answer you're looking for? Browse other questions tagged or ask your own question.