id or class?

Out of context: Reply #5

  • Started
  • Last post
  • 6 Responses
  • jonatne0

    IDs are meant to name elements.
    The idea is that the ID is a 'unique identifier' (BattleAxe) and as they have all said, each ID name can only be used once. Depending on what element you are giving and ID too, that element can be accessed via a #elementname anchor.

    Classes are meant to 'classify' elements. They should be used to say what type of a certain element is or what group it should fall into. You can also have multiple classes on one element. (ex. class="red hidden important" )

View thread