DEV Community

Cover image for What is Nesting
Melina Caroline Bernard
Melina Caroline Bernard

Posted on

What is Nesting

•Some tags need to be placed inside other tags.

•When some HTML tags go inside other tags, this is called nesting.

•For example, all the contents of the html are included (nested) inside <html> tag

•The outer tag (<html>,in this example), is called a Parent tag and all the tags nested inside it are Child tags

📎A Golden Rule
the last tag you open must be the first tag you close.
So, you can close the parent tag only after closing all the child tags in nesting

💡Fun fact
<html> </html> tag is a container tag, which contains all the contents of html nested inside it

Top comments (0)