0
How do i know when to use <section> or <aside>?
For instance, if I want to create an online retail store, will the items displayed for sale be coded as sections of the article or asides of the article. And why?
5 Respostas
+ 4
if you are making online retail store then I advise you that you do not use section or aside..instead use div tags.
If you are writing an article..you can divide the article using section. Aside is used if you want to put material around the article.
+ 2
The <section> element "is a thematic grouping of content, typically with a heading." ( W3C's HTML5 documentation )
The <article> element specifies independent, self-contained content. An article should make sense on its own, and it should be possible to read it independently from the rest of the web site.
source: http://www.w3schools.com/html/html5_semantic_elements.asp
You must use the new semantics html5 elements to follow W3C recommendations, and because they are helpfull to better organize your content ( you can also benefit from a better indexation by search engines )... However, the semantics meanings are almost subjective... I think the most important is to have a logical content structure, even if tags like <section> are so little bit different from the generic <div> ( which still and initially stand for DIVision -- My interpretation is to use <section> as mothers divisions, and <div> for subdivision ( to limit the nested sections ) and generic content box ).
+ 1
I dont think people use that at all. Create divs and place them around with the help of CSS rules.
+ 1
aside is used when you want to replicate code mostly, like a sidebar with common links, otherwise use section.
0
Aside for side content, maybe used for sidebar, navigation, and within article. All depend on your page structure.