2015-11-22 115 views
0

我創造了這個結構:HTML5標記和標題

<header> 
    <h1>page name</h1> 
    <nav> 
    <ul> 
     <li><a href="">Item 1</a></li> 
     <li><a href="">Item 2</a></li> 
    </ul> 
    </nav> 
</header> 
<main> 
    <h1>Latest Articles</h1> 
    <article> 
    <header> 
     <h1>Article heading</h1> 
     <time>25.5.2020</time> 
    </header> 
    <p>article content</p> 
    </article> 
    <article> 
    <header> 
     <h1>Article heading</h1> 
     <time>25.5.2020</time> 
    </header> 
    <p>article content</p> 
    </article> 
</main> 
<section> 
    <h1>Most active users</h1> 
    some content here 
</section> 
<section> 
    <h1>latest forum post</h1> 
    content here 
</section> 
<footer> 
    copyright and bullshits 
</footer> 

我想請問如果整個代碼是很好的結構。如果我以正確的方式使用所有的html5標籤,並且標題如此。非常感謝回覆。

回答

1

結構看起來很好。但是請記住,遵循幾個不同的「準則」,即只要您以正確的方式(正確的標記,而不是結構)實現HTML標記,您的頁面仍將顯示在不同的瀏覽器中。我會說沒有一個真正的標準方式,你應該寫HTML,但你應該一定遵守W3C標準(因爲瀏覽器一般也遵守這些標準)。

通過W3C免費驗證服務在線測試您的html,如果通過,那麼剩下的只是「常見做法」以及關於如何組織事情的個人意見。

W3C Markup Validation

乾杯