HTML CLASS

HTML CLASS

In HTML we can provide class names to html elements. Latter we can use this class name to provide css styling to html elements. This makes styling easier. We can provide same css styling to elements with same class name. And also provide different style for different classes. Class name can be provided to the html element using class attribute.

CLASSING Block Elements

<div> is a block element. By giving a class name to this block we can style it according to our need. In css we can use the class name as the selector. Giving class name helps as to provide same styling to elements with same class name.
<!DOCTYPE html>
<html>
<head>
<style>
.samp{ background-color:blue; color:white; font-family:batang; }
.camp{ background-color:black; color:yellow; font-family:elephant; }
</style>
</head>
<body>
<div class="samp">
<h1>India</h1>
<p>India before British rule it was known as Bharath or Hindustan.India is a <br> land of diversity.It is a famous tourist location now a days.</p>
</div>
<div class="samp">
<h1>Kerala</h1>
<p>Kerala is known as Gods own country is a state in India. Its famous for its exotic land scapes.Its located at the end of western ghats in India.</p>
</div>
<div class="camp">
<h1>China</h1>
<p>It is th Largest country in th world. It is also the country with largest population.China is famous for its world wonder GREAT WALL OF CHINA.</p> </div>
</body>
</html>

India

India before British rule it was known as Bharath or Hindustan.India is a
land of diversity.It is a famous tourist location now a days.

Kerala

Kerala is known as Gods own country is a state in India. Its famous for its exotic land scapes.Its located at the end of western ghats in India.

China

It is th Largest country in th world. It is also the country with largest population.China is famous for its world wonder GREAT WALL OF CHINA.

0 Comment "HTML CLASS"