+ 1

Is it more effective to use id or class ?

7th Jul 2018, 5:58 AM
Maritza Palacios
Maritza Palacios - avatar
4 Antworten
+ 8
depends on what you want. if your element is the only of such in the dom use id. if there are multiple similar elements,use class
7th Jul 2018, 6:08 AM
᠌᠌Code X
᠌᠌Code X - avatar
+ 1
IDs can only be used once per page so it’s nice if you need to be really specific. If you want to style multiple elements from different webpages, I would use class.
14th Jul 2018, 2:15 AM
Monica Rodriguez
Monica Rodriguez - avatar
0
class
8th Jul 2018, 7:21 PM
aravindh
aravindh - avatar
0
dom use Id selector and multiple use class selector
8th Jul 2018, 7:22 PM
aravindh
aravindh - avatar