What is the correct tag for grouping elements into an aside

Asked

Viewed 691 times

3

I’m creating a sidebar for my site, I want to put something like "last posts, social network, a kind of top downloaded etc." or something simpler "last posts" just :D .. inserir a descrição da imagem aqui but I’m in doubt about tag aside, read, reread, and still reading about it but floating.. is really the right tag to create that part of the site ? is what can group these elements, say: "last posts, social networks" etc.. Section ? article ? ul ? ... vlw

I know it needs to be related to the main content of the page, but I do not know if what I proposed this related to the post .. example: article about cars, but my aside has last posts and social networks .. it doesn’t seem related, but there’s a lot of website that uses aside that way, I’d like to understand if it’s correct .. thanks who help

Edit:The element can be used for typographical purposes like pull quotes or sidebars, for advertising, for groups of Nav elements, and for other content that is considered separate from the main content of the page.

I took it from the https://html.spec.whatwg.org/ , if I understand correctly(I hope so) I can use it for content separate from the main content, such as social networks, last posts etc.. ?

2 answers

2

That is exactly the purpose of tag aside, can use without fear! Generally, for this type of structure I would use the 4 tags:
header / Section / aside / footer
to group, respectively:
header / body (main content) / sidebar (with links to navigation, etc.) / footer.

1

Complementing the answer:

<aside> as the friend @Igorsantos said is correctly used for this type of content, the famous "sidebar".

About the other tags:

<section> Used to contain each "section" of the main content of your page

<article> used for an indicate that the content within it is an article (post)

<ul> used to create an unordered list:

<ul>
  <li>
  </li>
  <li>
  </li>
</ul>

Since you may obviously have one <article> within your <aside>.. It’s basically out there... you can read better about the HTML tags in this article:

https://developer.mozilla.org/en-US/docs/Web/HTML/HTML5/HTML5_element_list

Browser other questions tagged

You are not signed in. Login or sign up in order to post.