2

I've been reading a lot about Semantic HTML lately and I've been looking at examples at MDN and www.w3.org. However I can not find an explicit answer to this:

Is it semantically correct to have a section with articles as content?

Something along the lines of this:

<section>
  <h2>Latest Posts</h2>
  <article></article>
  <article></article>
  <article></article>
</section>

Closest I've found to that structure is what Morten Rand did at his site: https://mor10.com/ But he's not wrapping the articles with a section but a main tag instead.

allenski
  • 1,652
  • 4
  • 23
  • 39
VdeVentura
  • 2,041
  • 2
  • 15
  • 16
  • 3
    Does this answer your question? [How to use
    and
    tags in HTML5?](https://stackoverflow.com/q/26883406/1591669) -- If yes, I’d suggest to mark it as duplicate
    – unor Jul 29 '17 at 07:27
  • 1
    @unor the answer to that question definitely answers mine, but I don't know wether to mark mine as a duplicate or not, as the question itself is different. He seems to be asking a more generic question about Articles and Section and I was looking for an specific use case. I feel this question could help other people looking for this, as it's a more explicit question. – VdeVentura Jul 29 '17 at 19:04

1 Answers1

3

Yes, you can

A <section> element simply represents a generic section of the page. A section on the page can most definitely contain an <article>.

This page talks about the <article> tag, but it does discuss using it inside of a <section> element, confirming this:

Where appropriate a <section> element can contain <article> elements.

Toastrackenigma
  • 7,604
  • 4
  • 45
  • 55
  • 2
    Thank you, that's exactly what I've been looking for! I'll wait a little bit before accepting your answer, just in case someone else comes with something superelaborated. But that source you gave... it's gold for me. – VdeVentura Jul 29 '17 at 19:10