HTML Hierarchy

The HTML of a web page is like a family tree, where the HTML tags represent various family members. HTML has tags within tags also called nested tags. The relationship amongst these tags or how they’re nested within each other is like a family tree. Various relations are explained as
  • Descendent. A tag inside one or more tags is a descendent like the <body> tag is a descendent of the <html> tag.
  • Parent. It is the closest ancestor of another tag or it is the first tag directly connected to and above another tag like the <html> tag is the parent of the <head> and <body> tags.
  • Child. A tag that’s directly enclosed by another tag is a child like <head> and <body> tags are child of the <html> tag .
    Sibling. Tags that are children of the same tag are called siblings as brothers or sisters like the <head> and <body> tags are siblings.
As illustrated in the figure
HTML Hierarchy 1HTML Tree
HTML Hierarchy 2
HTML Hierarchy
Share this post
[social_warfare]
Group Selector
Descendant Selector

Get industry recognized certification – Contact us

keyboard_arrow_up