aside inside the header

Asked

Viewed 96 times

0

Hi, I was wondering if it’s semantic to use the tag <aside></aside> inside the head in a menu that is fixed in the header of the page next to the logo of the site, in my conclusion I think it is wrong because the tag <header> is a tag that indicates a section of the page, in case the top, but it would be wrong to insert only the menu <nav> right in the <header>.

  • I think the lack of use of interrogation (?) in the text of your question left her a little confused. It is not well known where is a question and where is a statement.

  • In my view Aside is a content classified as complementary, or the part, and it can be present in Sctions, Articles, Headres, etc., it is a secondary element, but that is part of where it is inserted.

  • face was bad was in a hurry I’ll spend more attention to that

2 answers

0

If the tag in question is a <header ... />, yes it would be semantic since the proposed structure is something like the example of w3c itself. http://w3c.github.io/html/sections.html#the-header-element

<article>

  <header>
    <h1>Flexbox: The definitive guide</h1>

    <aside>

      <header>
        <h2>About the author: Wes McSilly</h2>
        <p><a href="./wes-mcsilly/">Contact him! (Why would you?)</a></p>
      </header>

      <p>Expert in nothing but Flexbox. Talented circus sideshow.</p>
    </aside>

  </header>

  <p><ins>The guide about Flexbox was supposed to be here, but it
    turned out Wes wasn’t a Flexbox expert either.</ins></p>

</article>

You can also read the documentation in which you get more information about the use of these and other tags in: http://w3c.github.io/html/sections.html#sections

0

Official description

This page W3C describes the header element as follows:

The header element represents Introductory content for its Nearest Ancestor main element or sectioning content or sectioning root element. A header typically contains a group of Introductory or navigational aids.

Translating:

The header element represents introductory content for your nearest main ancestor or content storage or Root element processing. A header typically contains a group of introductory or navigational aids.

So your statement is not exactly correct:

...is a tag indicating a section of the page, in case the top...

This is because, semantically, the element is used to present an introductory content, but not just to make a section of the top.

Mom, who’s my dad?

The MDN speaks that the tag <aside> may have any parent element that accepts flow content.

Any element that accepts flow content. Note that an element <aside> shall not be descended from an element <address>.

Moreover, this page W3C (example 20) proves what has been said by the following code::

<article>
  <header>
    <h1>Flexbox: The definitive guide</h1>
    <aside>
      <header>
        <h2>About the author: Wes McSilly</h2>
        <p><a href="./wes-mcsilly/">Contact him! (Why would you?)</a></p>
      </header>
      <p>Expert in nothing but Flexbox. Talented circus sideshow.</p>
    </aside>
  </header>
  <p><ins>The guide about Flexbox was supposed to be here, but it
    turned out Wes wasn’t a Flexbox expert either.</ins></p>
</article>

Completion

Given this, and adding, I often think that <aside> comes from an English phrase: aside from content (apart from the content).

Thus, it is clearly perceived that it can be used "next to" content, no matter if it is a paragraph or header.

  • vlw, it helped a lot still to learning why of the gaffes

  • Dude, you asked a question to learn. Gaffe would be not wanting to learn.

Browser other questions tagged

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