DEV Community

Rita Kairu
Rita Kairu

Posted on

What is the difference between <main> and <body> in HTML?

The difference between and is in the content embedded in these elements.

captures the "main" elements unique to a particular document. It doesn't capture repetitive elements or contents such as the navigation bar, side bar, and the footer.

on the other hand can capture all content embedded in it. Including footers, navigation bars, copyright stamps etc.

Top comments (0)