Class selector is used when we want to apply style on many items that contain respective class
but ID selector is used for unique elements.
<p class="newclass"> </p>
<p class="newclass"> </p>
<p id="pid"> </p>
in css file
#pid{
/*we use # sign for ID selector and it will e unique for a element */
}
.newclass{
/* (dot) . sign is used for class and we can assign a class to many elements. */
}
but ID selector is used for unique elements.
<p class="newclass"> </p>
<p class="newclass"> </p>
<p id="pid"> </p>
in css file
#pid{
/*we use # sign for ID selector and it will e unique for a element */
}
.newclass{
/* (dot) . sign is used for class and we can assign a class to many elements. */
}
No comments:
Post a Comment