Login | Register
Compare Gas & Electricity Prices

Latest Complaints

Latest Reviews/Articles

Latest News & Stories

By: web design tutorial | posted in HTML/CSS, Tutorials, Web Design |
Date: June 23rd, 2009

ID tags are very similar to class tag, that’s is why many people are confuse. I always wonder this myself…here is what I know…

ID tag can only be use once on a single page. For example, you have <div id=”something”>content here</div> you can not use it again on the same page. Actually, you can use the same id tags on the same page as many time as you like because many browsers do not enforce the HTML/XHTML rules but it will give you an error if you validate your page at w3c when you have two identical id tags on the same page.

So each id tag must be unique on a single page. Since id are only use once each page, it is very useful to identified a specific content on a page. For example, you have a id for the header and another unique id for the footer and if you want to have the link color for the header to be different from the footer you use id to separate the header and the footer.

It might seem that class are more powerful than id because you can only use id once per page, but that is not true. ID are more powerful than class and it can overwrite the class tags if the style conflict with each other.

That’s all for now. I hope this make sense. If you don’t get it just post comment below and I’ll do my best.

More info on with the below links.

Do you like this article?

By: web design tutorial
Site:
Info:

Keyframe5 is not responsible for comments provided by external users for the accuracy, authenticity or reliability of the content. Read our Terms of Service.

Comment Pages

Post a Comment


Basic HTML tags are allowed: <blockquote> <a href> <strong> <em>
*