Page 1 of 3 123 LastLast
Results 1 to 10 of 23

what is different between id and classes

This is a discussion on what is different between id and classes within the Web Design forums, part of the Web Designing & Development category; what is different between id and classes...

  1. #1
    Senior Member Array
    Join Date
    Mar 2010
    Posts
    179

    Default what is different between id and classes

    what is different between id and classes

  2. #2
    Junior Member Array
    Join Date
    Jun 2010
    Posts
    4

    Default Re: what is different between id and classes

    You can use an ID name once in any XHTML or HTML document to identify large segments of the site or important information, link, etc. while classes can be used multiple times in the same HTML document to classify areas with a specific property. In the CSS a class selector is a name preceded by a full stop (.) and an ID selector is a name preceded by a hash character (#).

  3. #3
    Junior Member Array
    Join Date
    Aug 2010
    Posts
    4

    Default Re: what is different between id and classes

    A class is used to define one or more elements based on some author-defined criteria.An id is used to define a unique element on a page. I find ids are most useful for structured page layout Id is uniquely identify an element on the webpage, irrespective of its type button, div, radio etc. where as Class is used to identify a certain type of elements.

  4. #4
    Junior Member Array
    Join Date
    Aug 2010
    Posts
    5

    Default Re: what is different between id and classes

    Classes and IDs come from CSS. IDs are supposed to be unique within your HTML document classes can be used multiple times within the same document.ID, short for fragment identifier, is a beautiful attribute, but it's very easy to use them improperly.Classes, like ID's, can also be used to in JavaScript scripts, but unlike ID's, they can be used multiple times in the same HTML document.
    [SIZE=2]ipad stylus [/SIZE]

  5. #5
    Senior Member Array
    Join Date
    Aug 2010
    Posts
    104

    Default Re: what is different between id and classes

    Could you give an example of when you would ever really use id over class? I mean, id is limiting, while class is not. I understand what the difference is, but you could do everything about css not ever using id.

    Basically what is the id's big selling point, and why does it even NEED to exist?

  6. #6
    Junior Member Array
    Join Date
    Oct 2010
    Location
    UK
    Posts
    19

    Default Re: what is different between id and classes

    Hello Friends.........

    ID, short for fragment identifier, is a beautiful attribute, but it's very easy to use them improperly. You can only use an ID name once in any XHTML or HTML document. Duplicate ID tags will cause your page to fail validation, and can have negative effects when using JavaScript with them. Simply put, an ID is like the sticker that says "you are here" on a mall directory, and there can only ever be one of those.

    Classes, like ID's, can also be used to in JavaScript scripts, but unlike ID's, they can be used multiple times in the same HTML document. This separation of content from presentation is what makes sites powered by CSS more robust, but some don't know the full extent to which they can use classes.

    Thanks

  7. #7
    Member Array
    Join Date
    Oct 2010
    Posts
    41

    Default Re: what is different between id and classes

    thanks for sharing this information.

  8. #8
    Member Array
    Join Date
    Oct 2010
    Posts
    41

    Default Re: what is different between id and classes

    ID is used to identify the name of object in page using that you can get object in javascript.

  9. #9
    Junior Member Array
    Join Date
    Nov 2010
    Posts
    4

    Default Re: what is different between id and classes

    CSS I do not care that the signs are much higher than specific classes. This, of course, need to think in terms of CSS rules to replace the other in any number of style sheets.

  10. #10
    Junior Member Array
    Join Date
    Nov 2010
    Posts
    6

    Default Re: what is different between id and classes

    There are lot of between Id & Classes. id can be used only once but classes can be used multiple. id can be used as hyperlink & class cann't be.



Page 1 of 3 123 LastLast

Similar Threads

  1. Classes and IDs
    By msn90 in forum Web Design
    Replies: 1
    Last Post: 05-21-2009, 03:25 PM
  2. pseudo-classes
    By akash in forum Web Design
    Replies: 0
    Last Post: 05-04-2009, 07:02 AM
  3. Pseudo Classes
    By akash in forum Web Design
    Replies: 0
    Last Post: 02-24-2009, 06:28 AM
  4. Inheritance, Polymorphism, and Abstract Classes
    By akash in forum Programming
    Replies: 0
    Last Post: 02-16-2009, 06:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO Forum | Web Hosting Forum | Websites For Sale |