0
Can someone teach me about class in Html, css, webdev with example??!!
1 Answer
+ 2
Class is a tag to allow you to put similar features without writing the same thing each time.
An example, you want 50% of your <p>s to have a size of 24px and the other half to be 36px.
So, you can add a corresponding class to each p and then write the style in CSS and it will be so.
<p class="twentyfour">para1</p>
<p class="thirtysix">para2</p>
<p class="twentyfour">para3</p>
<p class="thirtysix">para4</p>
In CSS
.twentyfour
{
font-size: 24px;
}
.thirtysix
{
font-size: 36px;
}