Good day. With the release of HTML5, a variety of additional tags and much more have appeared. And I want to use them correctly and properly. I studied several articles on the Internet ( for example ). But I want to clarify some nuances just in case.

Planned page that displays a list of products of a particular category. On the page there will be: the main menu for navigating the site, sitebar with filters, product cards. I imagine the markup in general as follows:

<!DOCTYPE html> <html> <head> <title></title> </head> <body> <nav>Основная навигация по всему сайту</nav> <main> <h1>Название категории товара</h1> <aside>Фильтр</aside> <h2>Название товара</h2> <h2>Название товара</h2> <h2>Название товара</h2> <h2>Название товара</h2> <h2>Название товара</h2> </main> </body> </html> 

I have doubts about the <main> tag. Perhaps it is worth choosing <article> ( <content> out of date)? As for the goods card, they are all in separate divs, etc. - I dropped them for clarity.

If you put the code in HTML 5 Outliner , it turns out that <nav> , which is not included in <main> taken into account in the structure and must have a header (because it does not exist, it is displayed as Untitled Section ). There is a similar situation with <aside> - it should have a title. Those. since they must have headers, are these blocks somehow taken into account? And maybe replace them with regular divs? Or something else?

Hence the questions: did I choose the right way to mark the document for the page with product cards? Is the reporting procedure correct? Do I use correct tags for markup? How to deal with the headings of <nav> and <aside> ? How it all affects SEO, etc. etc.? Are there any additional recommendations?

The question of micromarking of each product stands apart. Now in the priority (if I am not mistaken) JSON for Linking Data . There is, of course, schema.org , but it seems that the same Google already prefers not this technology, but JSON for Linking Data. It is clear - it is much more convenient to work . Has anyone worked with this technology in the key of the page description with product cards, and not one single product?

upd. As a result, I came to the structure of the document of the form:

 <!DOCTYPE html> <html> <head> <title></title> </head> <body> <nav>Основная навигация по всему сайту</nav> <aside>Фильтр</aside> <article> <h1>Название категории товара</h1> <section><h2>Название товара</h2></section> <section><h2>Название товара</h2></section> <section><h2>Название товара</h2></section> <section><h2>Название товара</h2></section> <section><h2>Название товара</h2></section> </article> </body> </html> 

upd2.

 <!DOCTYPE html> <html> <head> <title>Сайт</title> </head> <body> <header> <h1>Название сайта</h1> <nav><h2>Навигация по сайту</h2></nav> </header> <article> <h2>Название категории товара 1</h2> <aside><h3>Фильтр</h3></aside> <section><h3>Название товара 1</h3></section> <section><h3>Название товара 2</h3></section> <section><h3>Название товара 3</h3></section> <section><h3>Название товара 4</h3></section> </article> </body> </html> 

It looks like: view

However, the questions are still relevant. Help to understand, please.

  • Look at your latest structure. In it, Site Navigation is the second largest value to which you pay attention to the search engine and browser. My opinion is that navigation in general should not be denoted by the elements h. She has enough structured markup. In my opinion, in your latest structure, the main theme of the page is Product Category, but not navigation. - nikant25

1 answer 1

I recommend the following source code to you:

 <!DOCTYPE html> <html> <head> <title></title> </head> <body> <main> <h1>Название магазина/сайта</h1> <nav>Основная навигация по всему сайту</nav> <h2>Название категории товара</h2> <aside>Фильтр</aside> <h3>Название товара</h3> <h3>Название товара</h3> <h3>Название товара</h3> <h3>Название товара</h3> <h3>Название товара</h3> </main> </body> </html> 

Here the hierarchy goes down from the shop name. This structure reports that the specified product category and all product names are part of the store / site. Do not forget that from the elements of h, search engines take information, the so-called Long Tail. The specification of the main element :

The tag specifies the main content of a document - the <home> tag defines the main content of the document.

There is no clear requirement for this item. I believe that your main content is indicated in this element, but your choice is not an error. This element should be used on the page only in a single copy. Elements of article and section can be used many times. All these elements are semantic elements of the standard CTML5 . With them you can fragment / segment the source code of pages. In addition to the HTML 5 Outliner you specified, you can use the W3 validator , with the choice of the outline filter. See the result below in the Heading-level outline and Structural outline sections. In my opinion, this tool gives a clearer visualization of the page structure. For a list of products, I recommend that you use the OfferCatalog structured markup. Below you can see examples of this markup in all applicable forms. This markup is a child / refinement markup of ItemList .

  • one
    Navigation is not part of the unique content of the page, therefore should not be in main. - Qwertiy
  • I studied your recommendations and came to a new solution for myself (see my question - upd2). As a result, the hierarchy is clearly visible down from the name of the store. In validators, all items have their own names, etc. (picture above). What do you think? - n.osennij
  • About micromarking. And how do you look at JSON for Linking Data? - n.osennij
  • Using JSON for Linking Data depends on your audience, because it is not supported by Yahoo + Bing (it seems), but these search engines have about 80% in Britain and just over 50% in Germany. In addition, if you install large amounts of data in the structured markup, you will have to duplicate it using JSON. And this makes the page heavier and slows down. But Google does it in every way. - nikant25
  • The W3 specification does not indicate that main contains unique content, but the main content. Here I see the difference. - nikant25