Use of id and class atributes in html?

2 replies
  • WEB DESIGN
  • |
Both can be used by either CSS or Javascript. An id uniquely identifies an element. ................?
#atributes #class #html
  • Profile picture of the author neoaquino
    yup that's what id for its a unique to a certain element that can be only use once unlike class were you can use it over and over again
    {{ DiscussionBoard.errors[9597900].message }}
  • Profile picture of the author jimbean
    Think of an id as the full name of the element and it is how you can identify it from all the other elements. Think of a class as a way of grouping the elements e.g. You may have a group of elements that are people and another that are animals. By grouping them in a class you can do things like make all the people green and the animals red etc. Ids are referenced by a # and classes are referenced by a .
    Signature

    Internet Marketing Blogger for Jim's Affiliate Marketing offering how to articles, reviews, recommendations and personal experiences.

    {{ DiscussionBoard.errors[9597927].message }}

Trending Topics