Skip to content
EIGHTH LESSON OF HTML
<!DOCTYPE html>
<html>
<head>
<title>Eighth Lesson of HTML</title>
<head>
<body>
<h2>What is CSS?? What role it plays for HTML??</h2>
<h3>CSS, is cascading style sheets. This is the way to decorate or style our html page to make it look more attractive. CSS can be add in 3 ways in HTML element.
1)Inline
2)Internal
3)External
</h3>
<p>Inline - This can be use within the HTML element, with style attribute.</p>
For example:
<h2 style="color:red;">You are learning CSS lesson through JS Informatics!!!</h2>
<!---Above code shows, inline styling---->
<p>Internal - This can be use in the head section of HTML page, with style attribute.</p>
<p>External - This can be use by making another file or external sheet, which can be linked in the main or index file.</p>
</body>
</html>
Now, Few Key points to remember always:
- External stylesheet always be saved with .css extension.
- External stylesheet is a good practice of using CSS, because with just only one file, we can change the look of complete webpage or website.
Seventh Lesson of HTML
.festive h4{
color: red;
font-family:calibri;
}
.festive p{
color: blue;
font-family:verdana;
}
<!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.