+ 1

Could css pseudo elements ::before and ::after be used without selecting any html tags?

E.g *, *:: before, *::after. Like that just don't understand.

18th Mar 2021, 4:02 PM
Immaculate Prince
Immaculate Prince - avatar
3 Antworten
+ 2
you cannot use before and after pseudo element without selecting at least one element (before and after what if not?) however, with * you select all elements... so your before/after rules will apply to all element, unless you overide that later with higher precedence ^^
18th Mar 2021, 4:20 PM
visph
visph - avatar
0
Alright thanks very much,👍
18th Mar 2021, 5:50 PM
Immaculate Prince
Immaculate Prince - avatar
0
I now understand
18th Mar 2021, 5:51 PM
Immaculate Prince
Immaculate Prince - avatar