Do I still need this in 2021?
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: '';
content: none;
}
Can I get an explanation for what these do?
Do I still need this in 2021?
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: '';
content: none;
}
Can I get an explanation for what these do?
That's only if you're looking to reset the CSS so those elements will inherit parent styles -- potentially up to body
and html
. Semantically, blockquote
and q
elements are used when citing another source according to W3schools.com.
From a user standpoint, you would want to style these as a recognizable quote but to answer the question of purpose: the code is to remove the indent and ensure the default browser styles are removed, your html page may include additional styling that particular code is removing.
See the unstyled blockquote
and q
below:
<blockquote>This is a blockquote element</blockquote>
<q>This is a q element</q>
A further breakdown of the CSS:
blockquote, q {
quotes: none;
}
quotes
is removing quote styling and
blockquote:before, blockquote:after, q:before, q:after {
content: "";
content: none;
}
is removing pseudo elements :before
and :after
content.
"This is a famous line"` versus `
This is a famous line` (with quotation marks applied automatically) – franklylately Mar 15 '21 at 02:41
element. When I use the– Oxin Mar 15 '21 at 02:59element, by default it has quotes that get added. So by using quotes: none; I am removing those quotes that are added by default.
` is for inline quoting -- `– franklylately Mar 15 '21 at 03:01The president commented,
` while `Please don't quote me on this.` is a 'stand alone' element in between other elements.