我们如何在HTML5文档中显示主要内容?

HTML <main>标记指定文档中的主要或重要内容。每页只能使用一次,并且不能用作<article>,<aside>,<footer>,<header>,<nav>元素的后代。

示例

您可以尝试运行以下代码,以了解如何在HTML文档中显示主要内容-

<!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>