How do we display the main content in the document in HTML5?

The HTML <main> tag specifies main or important content in the document. It can be used only once per page and can't be used as a descendent of <article>, <aside>, <footer>, <header>, <nav> element.


You can try to run the following code to learn how to display the main content in an HTML document −

<!DOCTYPE html>
         <p>Learn to gain experience and try to share your knowledge with others.</p>

            <h3>Web Development Tutorials</h3>
            <p>Consist of CSS, HTML, and PHP tutorials for 2nd Semester exams.</p>

            <h3>Academic Tutorials</h3>
            <p>Consist of Computer Fundamental, Computer Network tutorials for 1st Semester exams.</p>