+ Reply to Thread
Results 1 to 4 of 4

Thread: Div Class / Div ID ??

  1. #1
    mikel2k3 is offline x10 Lieutenant mikel2k3 is an unknown quantity at this point
    Join Date
    Aug 2005
    Location
    West Yorkshire - UK
    Posts
    374

    Div Class / Div ID ??

    Hey,

    I know that this will sound like an amazingly n00b question, but im sure ill get over it.

    Basicly I want to know what difference it make when making CSS layouts when you put in the html

    <Div class="Something"></Div>
    OR
    <Div id="Something"</Div>

    Does it make any difference about which one to use, and I know you can use them on conjunction with each other too.

    Thanks,
    Mike Distras
    -----------------------------------
    -----------------------------------

    http://www.DistrasDesigns.com

    -----------------------------------
    -----------------------------------

  2. #2
    lambada's Avatar
    lambada is offline x10 Elder lambada is an unknown quantity at this point
    Join Date
    Mar 2006
    Location
    Caister, Gt Yarmouth, Norfolk, ENGLAND
    Posts
    1,222

    Re: Div Class / Div ID ??

    div id should be used only once on each page
    div class should be used more than once on each page

    Using id more than once will spit out a validation error when using the w3c validator.
    Last edited by lambada; 10-13-2007 at 01:01 PM.
    Lambada - the former Account Manager (before I resigned)




  3. #3
    eminemix's Avatar
    eminemix is offline x10 Lieutenant eminemix is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    EU
    Posts
    349

    Re: Div Class / Div ID ??

    It's better to use div class if you want to use it more than once.
    And as lambada said, in html 4.0 and xhtml using id more than once will make the page invalid according to w3.


  4. #4
    FroziceX's Avatar
    FroziceX is offline x10Hosting Member FroziceX is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    1

    Re: Div Class / Div ID ??

    You should use div class more than once on a page and for div id you should only use it once per page. As lambada said.

+ Reply to Thread

Similar Threads

  1. PEAR Date class?
    By engineman in forum Free Hosting
    Replies: 2
    Last Post: 09-26-2007, 01:04 PM
  2. class doesn't work
    By nightscream in forum Free Hosting
    Replies: 2
    Last Post: 06-27-2007, 11:14 AM
  3. To all those who died (Viriginia Tech Students)
    By Chris Z in forum Off Topic
    Replies: 22
    Last Post: 04-20-2007, 12:05 PM
  4. Java Class path
    By Trixter in forum Free Hosting
    Replies: 2
    Last Post: 10-27-2006, 11:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers