Page 3 of 3 FirstFirst 123
Results 21 to 23 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; Hello Friends, We need ways to describe content in an HTML/XHTML document. The basic elements like <h1>, <p> and <ul> ...

  1. #21
    Senior Member Array
    Join Date
    Jan 2011
    Location
    India
    Posts
    116

    Default Re: what is different between id and classes

    Hello Friends,

    We need ways to describe content in an HTML/XHTML document. The basic elements like <h1>, <p> and <ul> will often do the job, but our basic set of tags doesn't cover every possible type of page element or layout choice. For this we need ID's and Classes. For example <ul id="nav">, this will give us the chance to target this unordered list specifically, so that we may manipulate it uniquely to other unordered lists on our page. Or we might have a section on our page that has no relevant tag to signify it, for example a footer, where we might do something like this: <div id="footer">. Or perhaps we have boxes in our sidebar for keeping content over there separated in some way: <div class="sidebar-box">.
    These ID's and Classes the "hooks" we need to build into markup to get our hands on them. CSS obviously needs these so that we may build selectors and do our styling, but other web languages like Javascript depend on them too. But what is the difference between them?

    Thanks

  2. #22
    Junior Member Array
    Join Date
    Feb 2011
    Posts
    21

    Default Re: what is different between id and classes

    - The definition of a class can be reused throughout the file and a ID can be used once.

    - ID is a specific element and the class is a class project.

    - ID and the class should be used this way even if it is an important use of them. It adds an additional layer of semantic code, which can be useful style.

  3. #23
    Junior Member Array
    Join Date
    Feb 2011
    Posts
    5

    Default Re: what is different between id and classes

    I acquisition this a actual advantageous address if you wish to accept absence styles activated to an aspect in all affairs but change its colour or accomplishments angel dynamically on altered pages. However, I've begin this adjustment seems to could cause problems in IE6, so I tend to shy abroad from it. Anyone abroad had this problem? I m abiding it's accurate in Site point CSS reference, but just anticipation I'd acknowledgment it.



Page 3 of 3 FirstFirst 123

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 |