HTML and CSS Reference
In-Depth Information
In this example, I've highlighted the styles that will be applied to the
elements inserted before and after the targeted element's content. Pseudo-
elements are somewhat unique in this way, because you insert the content
and the styles in the same declaration block.
Also note that typical CSS inheritance rules apply to the inserted elements. If
you had, for example, a font stack of Helvetica, Arial, sans-serif
applied to the <body> element of the document, then the pseudo-element
would inherit that font stack the same as any other element would.
Likewise, pseudo-elements don't inherit styles that aren't naturally inherited
from parent elements (such as padding and margins).
Search WWH ::




Custom Search