Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it semantically correct to have <nav></nav> tags inside of an <aside></aside> tag?

Tags:

html

I've been wondering about this for the past few days and thought I should register on this website since most of the answers I'm looking for come from here. I wasn't able to find this answer, however.

I'm just wondering if it's semantically correct to nest the nav tag in an aside tag? I'm brand new to the HTML5 scene from XHTML.

<aside>
    <nav id="locations">
        An Arizona City Here
        An Arizona Mountain Range
        An Arizona Destination Here
        Somewhere Arizona
        Tucson Location
        Bisbee Location Etc...
    </nav>
</aside>
like image 434
Brian Avatar asked Jan 23 '12 00:01

Brian


People also ask

Can NAV be inside aside?

Yes as long as it is an aside to the content of the elements around it.

Can you have a NAV inside a NAV?

Since NAV elements themselves are defined as Flow content, that means that NAV elements can contain NAV elements.

Should I put Nav inside header?

The <nav> tag is used inside the <header> tag . This may happen if <nav> is very small and if the content of <nav> tag is used to identify the different web content. In such cases, the <nav> is usually taken inside of the <header> tag.

Is Nav a semantic tag?

The links in the nav element may point to other webpages or to different sections of the same webpage. It is a semantic element. Common examples of the nav elements are menus, tables, contents, and indexes.


1 Answers

Yes as long as it is an aside to the content of the elements around it. If you are using it as "this is on the side of my main content in a column type area" then no, it is not appropriate. The semantics of the element is for content that is related to the main content, but not a part of it. You can read more on the w3c site that has "translated" the spec for web developers. It explains some example uses.

like image 192
LoveAndCoding Avatar answered Oct 15 '22 00:10

LoveAndCoding