+ 2
Classes ,div HTML
What are the use of classes ? I mean what is the use of class they don't do anything specific and I don't know anything about div.so guyz plz help me
2 Answers
+ 9
Acash like how Jay & Flandre Scarlet said, you can use the classes to give same style for the named (signed) blocks of your html code.
And use Jay Matthews's example, put this code to css tab:
.c1 {
margin:10px ;
padding:5px;
background-color: green;
border-color:black;
border-style:dashed;
text-align:center;
}
So to reach the given style of the c1 class, use the "." symbol before the name of the wanted class, so now: .c1 đ
reaching the style of the classes on CSS Tab with "." before the name (like .c1{}),
reaching id's style with "#" symbol before the name (like #i1 {})
+ 5
elements with the same class have the same css style