Home › Forums › Design › Bootstrap 3 Classes or IDs? › Reply To: Bootstrap 3 Classes or IDs?
October 21, 2013 at 2:42 pm
#153635
Participant
Actually, the spec seems to say you can have multiple IDs on an element (quote & source below), however I have yet to think of a reason why you’d want to do that, other than splitting the roles of styling/presentation, jQuery-hook, and linking for page-internal navigation.
Personally, I prefer classes whenever possible, IDs only when necessary.
“If an element has multiple ID attributes, all of them must be treated as IDs for that element for the purposes of the ID selector.”
http://www.w3.org/TR/selectors/#id-selectors