CSS Id and Class
The Id is used to specify a style for a single, unique element.
The id selector uses the id attribute of the HTML element, and is defined with”#".
Example
#para1
{
text-align:center;
color:red;
}
{
text-align:center;
color:red;
}
The class sector is most often used on several elements.
The class selector uses the HTML class attribute, and is defined with a "."
Example
.center
{
text-align:center;
}
The example is about p element with the class = “center”, will gives you central-aligned.
p.center
{
text-align:center;
}
Referencehttp://www.w3schools.com/css/default.asp

This comment has been removed by the author.
ReplyDeleteIt's a little bit like JAVA and C language.
ReplyDeleteNice examples ^-^
I understand that the difference between ID and class is that an ID selector can be called only once in a document, while a class selector can be called multiple times in a document.
ReplyDeleteThis is very useful blog entry. Well Done Vaibhavi!
@Dong: I know the basic of JAVA i dont know much, but i will learn it and put more on my blog later.
ReplyDeleteThis comment has been removed by the author.
ReplyDelete@Dong: Ya its like JAVA and C language!!!
ReplyDelete