...

View Full Version : Which code is semantically correct?



kayut
11-09-2012, 02:43 PM
Hi,

Regarding to HTML5 which of the following codes is right?:




<article>
<section></section>
</article>



OR




<section>
<article></article>
</section>



Thanks

Excavator
11-10-2012, 12:33 AM
Hello kayut,
I'm still working out the strict usage of the new HTML5 elements so I didn't reply to this post at first.
No answers for a bit now though so I'll say the second example is correct, but only if the aside contains information that makes sense on it's own, apart from the other information in it's containing <section>

felgall
11-10-2012, 12:39 AM
Hi,

Regarding to HTML5 which of the following codes is right?:




<article>
<section></section>
</article>



OR




<section>
<article></article>
</section>



Thanks

Surely that would depend on whether you have one article that is broken up onto sections or have one section of the page that is displaying multiple articles.

VIPStephan
11-10-2012, 01:06 AM
Also, a section should typically have a heading. So if you have no use for a heading, it is most likely not a dedicated section either. HTML5Doctor (http://html5doctor.com/the-section-element/) is a good read.

kayut
11-10-2012, 06:31 PM
Also, a section should typically have a heading. So if you have no use for a heading, it is most likely not a dedicated section either.
Read more at http://www.codingforums.com/showthread.php?p=1290367#IeL0m7OO9AKb7RDd.99

Agree! It makes sense?
However the question is:
Can an Article contains one or more sections?
If yes, can anybody give us an example?

kayut
11-11-2012, 07:58 PM
Any idea?

Excavator
11-11-2012, 09:05 PM
Can an Article contains one or more sections?


Yes, it would seem so. Explanation and example here (http://html5doctor.com/the-article-element/).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum