Results 1 to 6 of 6
Thread: H1 inside NAV?
Oct 2, 2013, 23:39 #1
- Join Date
- Jun 2008
- Madison, WI
- 34 Post(s)
- 2 Thread(s)
H1 inside NAV?
Ugh the HTML5 recommendation seems like the wild west. Valid code doesnt necessarily seem like good code and I was curious about where the experts would stand on this practice.
Often, when I code the masthead of a page I wrap the logo and navigation UL in a container; extra wrappers may be needed as hooks depending on the situation but lets assume that they are not needed. Think of floating the logo to the left and then a hz. nav bar floated to the right.. so that both elements are aligned at the top.
<div class="mast"> <div class="LogoAndNav"> <h1 class="logo">Co. Name</h1> <ul class='nav'>...</ul> </div> <p class="brand">...</p> </div> <div class='cont'></div>
It occurred to me that in HTML5 I could do this:
<head class="mast"> <nav class="LogoAndNav"> <h1 class="logo">Co. Name</h1> <ul class='nav'>...</ul> </nav> <p class="brand">...</p> </head> <main class='cont'></main>
The HTML5 spec even has a code sample similar to what i have posted here , but the specs fail to address what my concern is: that despite it being valid code.. it has a DIFFERENT SEMANTIC MEANING from what I intend since HTML5 heading do not necessarily denote document wide hierarchy.
In another words the heading inside the NAV element is not intended to mean "navigation" but "Some company's site". I mean I have put the NAV inside a HEAD element ( that's a direct child of the root element) but it still feels ambiguous.
What do the forum experts think. I would love to get some opinions on this practice.Tips for better/ faster SitePoint forum answers
Brilliant ideas, elegant execution.
Graphic Design, Art Direction, Copywriting and Web Design.