CSS NESTING

NESTING SELECTORS

It is possible to apply CSS styles to a group of elements of the same type.

For example, if you want all paragraphs <p> have blue text, without specifying anything in the HTML:

CSS :

p {color:blue; }

HTML :

<p>This is a CSS manually </p>

For example, if we want all HTML elements that have class = "green" with green text

CSS:

.green {color:green;}

HTML:

<h1 class="green"> The news of the day </h1>

For example, if we want all paragraphs have the edge "dotted".

CSS :

.dot p {border-style:dotted;}

HTML :

<p class="dot"> This is an example of paragraph </p>