# Structure of website columns and navigation

I have made this HTML5 structure for a new website I am working on. I'd like to know if there is a more elegant approach to doing it.

Here is the Wireframe

1. Is the wrapper for the two column considered bad practice?
2. Should the secondary navigation on the left be an article or a div?

<body>
<div class="wrapper">
<!-- Column left -->
<section class="column_left">
<article>
<h1>H1 title</h1>
<p>Lorem ipsum dolor sit amen lorem ipsum dolor sit amen</p>
</article>

<nav class="main">
<ul>
</ul>
</nav>

<p>button call to action</p>
</div>

<article class="secondarynav">
<ul>
</ul>
</article>

<article class="secondarynav">
<ul>
</ul>
</article>
</section>

<!-- Content -->
<section class="main">

<p>slideshow widget</p>

<article class="review">
<p>review widget</p>
</article>

<article class="product_grid">
<h2>product grid title</h2>
<p>Text text text lorem ipsum dolor sit amen </p>
<article class="products">
<ul>
<li>product 1</li>
<li>product 2</li>
<li>product 3</li>
</ul>
</article>
</article><

<article class="product_grid">
<h2>product grid title</h2>
<p>Text text text lorem ipsum dolor sit amen </p>
<article class="products">
<ul>
<li>product 1</li>
<li>product 2</li>
<li>product 3</li>
</ul>
</article>
</article>
</section>
</div>

<div class="clearfix">/div>

<!-- footer -->
<footer>
<div>footer</div>
</footer>
</body>

-
When you say Should the secondary navigation on the left should be a as well instead of an article or a div? are you referring to the wireframe instead of an article or a div? –  Ryan Gates Feb 1 '13 at 14:43
Do you have a page/example with real content? It's hard to tell what kind of content will be filled in. For example, is the "H1 title" the site or page heading? Is .main the site navigation? Is .secondarynav some kind of "See also" or is it a sub-menu of the global nav? –  unor Feb 2 '13 at 7:21
Hi, I used the same class .main for the main HEADER, NAV and SECTION (the main section is the right column, my content). The H1 and paragraph are in the left column in all the pages and the H1 is the page title. The ".secondarynav" is similar to "see also"... it's a menu but not very important. –  lucaguglielmi Feb 4 '13 at 9:01

Using classes/ids like column_left isn't a very semantic approach; HTML structure doesn't have any concept of "positioning" and, assuming you care about HTML readers other than a desktop browser (like screen readers or mobile devices), the idea of "left" just doesn't apply.

Instead, try describing what the content is. Instead of class="column_left", you could use id="sub-content" or id="related". Just choose something that describes the "what" without referring to appearance or positioning.

In regards to your use of article elements, the HTML5 spec says:

The article element represents a complete, or self-contained, composition in a document, page, application, or site and that is, in principle, independently distributable or reusable, e.g. in syndication. This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.

Key emphasis added to illustrate that article is meant to be used to say "this is some real content", distinguishing it from containers and markup added to "frame" the content (like sidebars).

Also, your use of section elements is not in-keeping with the specification. The HTML5 specification says:

The section element represents a generic section of a document or application. A section, in this context, is a thematic grouping of content, typically with a heading.

It specifically warns:

The section element is not a generic container element. When an element is needed for styling purposes or as a convenience for scripting, authors are encouraged to use the div element instead. A general rule is that the section element is appropriate only if the element’s contents would be listed explicitly in the document’s outline.

So, the idea of a "main" section probably isn't right. Sections are meant to be ways partition a large article into headed-sections, in very much the way a Wikipedia article is laid out. You could easily say you have a "main" article, but a "main" section doesn't make as much sense, and you'd be better off replacing yours with simple div elements.

-
1. Don't worry about wrapping your content too much if the style cannot be achieved without it. If it can, the extra wrap may be overkill.

2. Your markup relies a lot on the <article> where it may not be necessary. For instance, you put one <article> tag into another, which is odd. You also put and <article> tag into the <header>, which is also odd.

If you want simple containers, I would recommend you stick with <div>s with semantic class attributes. They have been around for a while and used for wrapping other tags. They are the tried and true method and their lack of semantic meaning will not confuse the reader or crawler.

-

I'd keep the wrapper, that way you can apply margin, padding, etc. to it and style the entire page instead of replicating the CSS for the two columns.

-