2014-09-23 90 views
0

這種修正是否正確地在語義上交談?我在HTML註釋中寫下了我的疑惑,以解釋我的想法。HTML5語義轉換

<article> 
    <h2>Movies</h2> 
    <h4>Genres</h4> 
    <p>Below you can see the <b>available genres</b>:</p> 
    <p>1. Action</p> 
    <p>2. War</p> 
    <p>3. Comedy</p> 
    <p>4. Horror</p> 
</article> 

VS

<section> <!-- Section instead of article? --> 
    <header> 
     <h2>Movies</h2> 
     <h4>Genres</h4><!-- Should i use to h tags inside the same header? http://www.w3.org/TR/html5/sections.html#headings-and-sections. There sais: "h1–h6 elements must not be used to markup subheadings, subtitles, alternative titles and taglines unless intended to be the heading for a new section or subsection. Instead use the markup patterns in the Common idioms without dedicated elements section of the specification."--> 
     <p>Below you can see the <b>available genres</b>:</p> <!-- <b> or <strong>?--> 
    </header> 
    <ol><!-- ol or ul and place the numbers? --> 
     <li>Action</li> 
     <li>War</li> 
     <li>Comedy</li> 
     <li>Horror</li> 
    </ol> 
</section> 
+0

是的,這似乎是適當的。 – Ryan 2014-09-23 17:41:14

+0

在HTML5中,您可以在任何地方寫評論。 – AvrilAlejandro 2014-09-23 17:41:37

+0

您應該關閉'

'順便說一下... – 2014-09-23 17:43:59

回答

-1

在HTML5中,你可以不管你想要寫評論。

<section> 
 
     <p> <!--new P tag --> 
 
      <span>new <!--this new paragraph-->paragraph</span> 
 
     </p> 
 
    </section>

0

部分和報頭都很好。什麼是流派的功能/互動?如果他們將是菜單選項,我會換行,否則我會使用UL,因爲它們不是按照需要維護的特定順序。

0

<b> - 「代表一定範圍的文本,從文體上偏離正常散文而沒有表達任何額外的重要性」。

<strong> - 「對其內容表示高度重視」。 source

其他標籤取決於它們的上下文。

0

文章是錯誤的 - 這沒有任何意義,例如在一個RSS提要。 section會好的,div可能會更好。

粗體只是爲了格式化,不是爲了強調,所以b會好的。

如果你堅持使用一節,header它應該有一個H1和H2,H3不和4

如果訂單事宜,ol,如果不是ul

+0

關於h1和h2,你能解釋一下這點嗎?我一直在閱讀這個:http://www.w3.org/TR/html5/sections.html#headings-and-sections – Mimetix 2014-09-23 17:59:53