CSS Id and Class
Apart from the defining th estyle for the HTML tag you can also define your coustom style using class and ID.There different ways todefine class and ID. Class is define using “.”and then the class name and ID is defined using “#” and than the ID name.
Let first take ID, ID is used to define the property of a unique element on the page. ID can be used only one time in a page, repeatation of the ID is not an valid HTML and CSS rule. ID can be define using # for example
#containwrapper{
width:980px;
padding:0 10px;
}
The above style will be applied to the element with the id containwrapper.
Now let us take class. Class is used to define a custom style which can used an number of time on the page. Class is defined using “.” and followed by class name.It is use to define the property of the HTML elements. for e.g.
.centerAlign{text-align:center;}
Text will be center align in all the element using the above class.
You can also define the or customize the property of the HTML using CSS for example
p{font-size:18px; color:#006600;}
All the P tag in the HTML page will have the above property.