CSS Selectors

André Luiz Batista Aureliano
1 min readOct 1, 2020

--

Lets start with the Regular selectors

1 — Element Selector

input{ … }
div{ … }

2 — Class Selector

.myclass{ … }
.anotherclass{ … }

3 — Id Selector

#myid{ … }
#anotherid{ … }

Priority of Selectors

Inline Style > Id > Class > Element

Lets see in action:

Advanced Selectors

(*) Universal Selector

It selects, well, everything! …but not the pseudo-elements ::after and ::before

*{ … }
.myclass *{ … }

To be continued…

--

--

André Luiz Batista Aureliano

Tech Lead Engineer @ InHire . Entrepeneur, Web/App Software Developer. “Hitting the head on the keyboard, until something goods happens”