Just to add on, :before and :after, :first-letter and :first-line are also valid due to their legacy usage, since they were introduced way back before the definition was finalized. But it is highly recommended that for newer code, we should follow proper convention.
It is not a mess if you look at the history with a border perspective. The big reason for all these messes is the fact that web was originally designed for documents. Then we sprinkled some dynamic elements on those documents. The current web is more like a platform, with payment api, device api, system api, some that were needed to improve web, some that were added by big corps purely for their own purposes and no relation to web at all. And a primary goal of web is to never break backward compatibility, so even though some things (like definition of psudo-elements and psudo-classes) were needed to change, they had to adopt it to make sure none of the past pages break.
There is an interesting post with CSS working group on their mistake list that they now realize but cannot change until time machine is invented. Do give it a read, you would enjoy it.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Just to add on,
:beforeand:after,:first-letterand:first-lineare also valid due to their legacy usage, since they were introduced way back before the definition was finalized. But it is highly recommended that for newer code, we should follow proper convention.Indeed, that’s why I didn’t mention it 😉
Thanks! My brain was going in a tizzy thinking about these. Damn, is CSS a mess?!
It is not a mess if you look at the history with a border perspective. The big reason for all these messes is the fact that web was originally designed for documents. Then we sprinkled some dynamic elements on those documents. The current web is more like a platform, with payment api, device api, system api, some that were needed to improve web, some that were added by big corps purely for their own purposes and no relation to web at all. And a primary goal of web is to never break backward compatibility, so even though some things (like definition of psudo-elements and psudo-classes) were needed to change, they had to adopt it to make sure none of the past pages break.
There is an interesting post with CSS working group on their mistake list that they now realize but cannot change until time machine is invented. Do give it a read, you would enjoy it.