Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Design Bootstrap 3 Classes or IDs? Reply To: Bootstrap 3 Classes or IDs?

#153635
Jesse
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