2015-02-23 67 views
0

有很多不同的答案,一週後我比以前更困惑。 主要問題是節和文章。 讓我們打一個比方,這個頁面描述了一個小鎮:部分和文章用法與例子

<h1>TownName</h1> 
<p>Description</p> 

<h2>What to see</h2> 
<h3>Sightseeing Nr1</h3> 
<p>Its description</p> 
<h3>Sightseeing Nr2</h3> 
<p>Its description</p> 
... 
<h2>How to get</h2> 
<h3>By car</h3> 
<p>Description</p> 
<h3>By train</h3> 
<p>Description</p 

<h2>Map</h2> 
<p>Description</p> 

<h2>...</h2> 
... 
etc. 

有h3的一些H2,對於一些沒了。我應該使用h2的每篇文章和h3的嵌套文章嗎? (上下文可以分開,所以..)

或者我應該使用部分爲h3?

或者我應該使用部分「h2」塊和每個h3的文章?

h1及其描述也是一篇文章或部分?

這是如此艱難,我也增加了我預期,我幾乎可以肯定,我沒有使用部分包放在一邊,主要內容頁面的圖像..

enter image description here

回答

0

振亞,這是W3學校

**Nesting Semantic Elements** 
In the HTML5 standard, the <article> element defines a complete, self-contained block of related elements. 

The <section> element is defined as a block of related elements. 

Can we use the definitions to decide how to nest elements? No, we cannot! 

On the Internet, you will find HTML pages with <section> elements containing <article> elements, and <article> elements containing <sections> elements. 

You will also find pages with <section> elements containing <section> elements, and <article> elements containing <article> elements. 
+0

所以它不容易理解在當前的例子,在那裏我有H1,H2鬃的您最佳的選擇,其中一些具有H3 ...其中哪些是文章和whick是部分。他們都可以被認爲是我的「完整元素」...我認爲 – Zhenya 2015-02-23 12:02:34

+0

根據您的想法,您可以在'文章'的'章節'或'章節'中放置'文章'。根據設計,您可以使用h1/h2/h3。 (分層流中的標籤)。它更好地檢查部分和文章的定義以獲得想法。 – 2015-02-23 12:15:29