0
What the function of attribut class= ? Plz reply...
2 odpowiedzi
+ 1
The class attribute is used to attach or define a class for a specific tag. So within your CSS stylesheet you could say .mystyle which has a background colour red. Then the div tag or p tag etc you can add <div class="mystyle">.
class is different from id, so although you can still style something using the id of an element by using #mystyle, this is bad practice as the id is for referencing something where as the class attribute is for attaching a style directly to it.
<div id="headerbox" class="headerstyle"></div>
.headerstyle {
height:200px;
width:100px;
background-color:#ff0000;
}
Hope that helps.
0
thanks...