[Solved] ID vs Class

  • # October 8, 2009 at 11:39 am


    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?


    # October 8, 2009 at 11:44 am

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


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


    # October 8, 2009 at 2:33 pm

    Got it thank you very much!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed