Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Apr 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Differences between Class and ID?

    What is the difference in using the class and ID attribute?, besides the following:

    Code:
    ID overrules Class
    And class can be used on as many elements and ID only on one element.

  • #2
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,303
    Thanks
    4
    Thanked 204 Times in 201 Posts
    That spells it out pretty darn clearly! What makes you think there's more to it than that?
    Dave .... HostMonster for all of your hosting needs

  • #3
    New to the CF scene
    Join Date
    Apr 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I too have wondered about this and its not easy finding something more than what you had in your post. Here's a link to a more spelled out definition.

    http://webdesign.about.com/od/css/a/aa020899.htm

  • #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    An id identifies a specific object.

    A class identifies a group of objects that have something in common.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •