HTML <main> 網頁主要區塊

<main> 標籤 (tag) 是用來放頁面主要資訊的區塊 (main content of the body),而每個頁面中只能有一個 <main>!什麼叫主要資訊?就是專屬於這一頁面的特有內容,不會在每一頁面都重複的 - 像是導覽列、側邊欄、logo、footer copyright 那些。

舉個例子:

<!-- other content, including navigation, perhaps -->

<main>
  <h1>Apples</h1>
  <p>The apple is the pomaceous fruit of the apple tree.</p>
  
  <article>
    <h2>Red Delicious</h2>
    <p>These bright red apples are the most common found in many
    supermarkets.</p>
    <p>... </p>
    <p>... </p>
  </article>

  <article>
    <h2>Granny Smith</h2>
    <p>These juicy, green apples make a great filling for
    apple pies.</p>
    <p>... </p>
    <p>... </p>
  </article>
</main>

<!-- other content, including a footer, maybe -->