CSS ๐๐ผ I don't know why *::before and *::after are included in the "box-sizing: border-box" reset
I know that
box-sizing: border-box
makes our lifes a lot easier. I've always just used the *
selector, but:
Why *::before
and *::after
?6 Replies
because just
*
doesnt include the before and after pseudoelementsFine! Those pseudoelements are used to place content before or after the elements, right?
Well, its a bit more complex than that but
Generally speaking they allow you to create and style a first and last child of the element they're referring to
the
::before
and ::after
are extra optional elements that aren't real
the *
refers to all tags
https://developer.mozilla.org/en-US/docs/Web/CSS/Universal_selectors
well, the correct term is "elements"
pseudo-elements aren't elements: they don't exist
but they also do existFantastic, thank you guys so much โฅ๏ธ๐
you're welcome