1 ID and Class Mon Nov 08, 2010 9:59 pm
Unknown Data
Registered Member
ID and Class Learn CSS - part 9 |
The attributes class and ID By using these to attributes can we specify special properties for selected elements. Class is normally used if we want to create two (or more) different elements with it's own speciel properties. ID is used to specifie one unique element property. There must not be two items with the same ID. Using the class Let's suppose that we have two departments in a company, department x and y. All links referring to the section x must be red and all links to department y must be yellow. By using the class element, will our HTML source look like this.
Using the ID I choose to use the example from before. But here are we changing some colors and using the ID instead of the class.
You surely have noticed that it's exactly the same as using the class element. Well let's move further to the next tutorial - DIV and span. |
Notice : This tutorial is copyrighted by WebArtz Forum. You may not publish it on anywhere without written permission from the administrators. |