1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Div id. Div class. ?

Discussion in 'CSS' started by Proficient, Oct 6, 2009.

  1. #1
    Could some one please explain the difference between a div class and div id, in simple english. Thanks =)
     
    Proficient, Oct 6, 2009 IP
  2. vagrant

    vagrant Peon

    Messages:
    2,284
    Likes Received:
    181
    Best Answers:
    0
    Trophy Points:
    0
  3. bigroddy

    bigroddy Peon

    Messages:
    78
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    In simplest terms, a class can be used on more than one element.

    An id is limited to one element on a page.
     
    bigroddy, Oct 6, 2009 IP
  4. blurredfringe

    blurredfringe Member

    Messages:
    77
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    48
    #4
    id can be used to reference calls in javascripts and DOM so an id must be declared once only. it's like a name of particular person in a class room wherein you can call him/her by name to refer to him/her specifically.


    whereas a class refers to a more generic usage. its like using the term "aspirin" without specifically naming a specific brand. it can be used multiple times anywhere on the page.
     
    blurredfringe, Oct 7, 2009 IP
  5. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Vagrant's link explains best, so instead, for your entertainment, I'll tell you something entirely off-topic until the thread dies (this forum seriously needs some stickies).

    The drug known in North America as "Tylenol" actually has two valid, legal names, one for North America (acetaminophen) and another the rest of the world uses (paracetamol). It's pretty unusual for one drug to have two valid names like this.
     
    Stomme poes, Oct 8, 2009 IP
    Kerosene likes this.