+ 1
Is it more effective to use id or class ?
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
+ 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.
0
class
0
dom use Id selector and multiple use class selector