sass-nesting

Sass Nesting

Sass syntax provides the facility to nest one style inside another style.

Nesting

Nesting is the process of placing code within other blocks of code.

Let us understand it with the help of an example.


Here see the HTML skelton, <h2> and <p> tag both is nested inside the div having class .container.

Nesting in Sass

Let us understand it with the help of an example.

Sass Syntax:

The above-nested style is also known as descendant selectors.

After compilation of the above Sass styles, the following CSS code will be obtained:

General Syntax

Try it yourself

Source Code

Try it yourself