Forums

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

Home Forums CSS [Solved] ID vs Class

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #26380
    fs_tigre
    Member

    Hi,

    Excuse my ignorance but I’m confused as when to use the ID and the Class <div> identifier, and I would like to know when it’s appropriate to use either one of these methods and when it is not.

    Can someone please be so kind and explain this a little bit?

    Thank

    #65185
    TheDoc
    Member

    An #id is something that will only be used once on a page. Examples:

    #wrapper
    #main-nav
    etc

    You use a class when something could appear more than once, like a photo gallery. Examples:

    .gallery
    .float-left
    etc

    #65190
    fs_tigre
    Member

    Got it thank you very much!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.