-2

Recently I've come to notice some people use <header>, <main>, <footer> tag, inside an <article> tag to determine the parts of an article. I want to know if this is right. Is it helpful for the search engine to optimize?

trying to find an answer.

Habib
  • 1
  • 4
  • From the seo tag. Note: General SEO questions are off-topic. Only programming-related SEO questions are acceptable on Stack Overflow. Non-programming SEO questions should be asked on Webmasters.SE at https://webmasters.stackexchange.com. If someone has directed you here to read this warning, go back and delete your question. – Rob Dec 14 '22 at 09:25

1 Answers1

0

Whether it's "right" or not is answered by the HTML specification, which states that the allowed content for an article element is flow content. This includes all the tags that you mentioned (header, main, footer).

There are however limitations when it comes to the use of the main element as it has a distinct set of allowed ancestor elements, which does not include article.

The specification has an explicit example of an article with header and footer elements, yet no main element.

Whether it's helpful for search engines is an entirely different matter, and feels like a question that cannot be answered without gathering some evidence comparing the behavior of various search engines.

Robby Cornelissen
  • 91,784
  • 22
  • 134
  • 156