
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
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.
Example
You can try to run the following code to learn how to display the main content in an HTML document −
<!DOCTYPE html> <html> <body> <main> <h1>Learning</h1> <p>Learn to gain experience and try to share your knowledge with others.</p> <article> <h3>Web Development Tutorials</h3> <p>Consist of CSS, HTML, and PHP tutorials for 2nd Semester exams.</p> </article> <article> <h3>Academic Tutorials</h3> <p>Consist of Computer Fundamental, Computer Network tutorials for 1st Semester exams.</p> </article> </main> </body> </html>
- Related Articles
- How do we create a footer for a document or section in HTML5?
- How to display incorrect content using HTML5?
- How do we add document title in HTML?
- How do we set the text direction for the content in an element in HTML?
- How do I display the content of a JavaScript object in a string format?
- How do we include the direction of text display in HTML?
- How do we embed audio in web pages in HTML5?
- How do we include a section in an HTML document?
- How do we display inserted text in HTML?
- How do we display a script in HTML?
- How do we specify the target for where to open the linked document in HTML?
- How to define a thematic change in the content in HTML5?
- How to add caption for the parent content in HTML5?
- Why do we use DOCTYPES in HTML document?
- How do we display a table cell in HTML

Advertisements