CSS Pseudo element syntax -


this vanity question, you've been warned!

i've never been fan of partial definitions such as

.flexaround1 {     display:flex;     justify-content:space-around;     align-items:center; }   .flexaround1::before {     content:""; }  .flexaround1::after {     content:""; } 

today, "but if!?!?" , tried this:

.flexaround1 {     display:flex;     justify-content:space-around;     align-items:center; } ::before {     content:""; } ::after {     content:""; } 

and whaddayaknow, works. thing though, i've never seen written in of tutorials or reference sites. proper css syntax or kind of unofficial somehow supported feature?

from mdn

a css pseudo-class keyword added selectors specifies special state of element selected.

a pseudo class keyword added selectors. mdn goes on give syntax, defining as

selector:pseudo-class {   property: value; }  

so appears leaving out selector isn't valid css (and kind of defeats idea of pseudo class in first place anyways). leaving out selector appears still work, however, selector defaults *, applying pseudo class elements.


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -