Monday, 6 March 2017

HTML Lesson - 7

Seventh Lesson of HTML














<!DOCTYPE html>
<html>

<head>

<title>Seventh Lesson of HTML</title>

<style>
.festive h4{
     color: red;
     font-family:calibri;
}
.festive p{
     color: blue;
     font-family:verdana;
}
</style>
</head>

<body>
<h2>What are classes in HTML ???</h2>


<p>The class is an attribute in HTML, which helps in defining the same style to each element with the same class name. CSS through class can be defined using [ . ] as prefix i.e.  .classname.</p>

For example:

<div class="festive">

<h4>DIWALI </h4>

<p>Diwali is the festival of lights. It is a five day festival and celebrated with the great joy and happiness.</p>

</div>


<div class="festive">

<h4>CHRISTMAS</h4>

<p>Christmas is the festival of forgiveness mainly celebrated by Christian Community. Lord Jesus, born on this auspicious day. Carols and Cakes make this festival more joyful.</p>
</div>


<div class="festive">

<h4>HOLI</h4>

<p>Holi is the festival of colors. It spreads a message of unity for all with different caste and communities, just like different colors merge in each other.</p>
</div>
</body>
</html>


Now, few key points to remember:

  •    A class should always be call with [ . ] or dot as prefix.
  •    Same class can be used for multiple elements.

Related Posts:

  • HTML LESSON - 3   THIRD LESSON OF HTML <!DOCTYPE html> <html> <head> <title>Third Lesson of HTML</title> </head> &l… Read More
  • HTML LESSON - 4   FOURTH  LESSON OF HTML <!DOCTYPE html><html> <head> <title>Fourth Lesson of HTML</title> <head>&l… Read More
  • HTML Lesson - 7 Seventh Lesson of HTML .festive h4{      color: red;      font-family:calibri; } .festive p{   … Read More
  • HTML Lesson - 6 SIXTH LESSON OF HTML   <!DOCTYPE html> <html> <head> <title>Sixth Lesson of HTML</title> </head> <bod… Read More
  • HTML Lesson - 5 Output of the code given   FIFTH LESSON OF HTML Now, Few Key point to remember always: The td tags contain data like images, t… Read More

0 comments:

Post a Comment