[uf-discuss] Semantic naming of HTML document layout elements

Robin Winslow robin at robinwinslow.co.uk
Thu Dec 29 19:24:01 PST 2011


Stephen Paul Weber wrote:
> The correct solution is not not have such a hackish element in your markup.
> I never do.  CSS is powerful enough that you don't need it, it just wastes
> space.

I completely agree that it would be lovely not to have any "hacky"
elements in my mark-up, and just have "header", "aside", "article" ,
"footer" as my container elements, but I don't know of any way to
achieve a centralised and squeezed layout without a container element.
E.g.:
http://jsfiddle.net/nottrobin/qcqzC/3/

> Is the nav part of the header (in your concept of the page) or not?  There's
> your answer.

My question was whether the nav should be part of the header in the
accepted semantic meaning of the elements. But since they put <nav>
inside <header> in the W3C's example
(http://dev.w3.org/html5/spec/Overview.html#the-header-element) I
guess it should be.

> Sidebars are often <aside> (if they are content that
> is tangential to the main content, as they often are) and are also often
> <nav>.  Sometimes they are neither.

Absolutely. I found a good article about <aside> and sidebars:
http://html5doctor.com/aside-revisited/

siegfried wrote:
> BTW: such a "hackish" element does not only waste space. Every class
> attribute classifies its content. So what does it mean, if the content
> of the container is classified "container"? The only logically correct
> semantic would be, that the content itself is a container of something.
> Since any html element is a container of some sort, and
> class="container" does not classify the type of the content (i.e. adds
> nothing to the semantic of its content), this information is unnecessary.

This is an accurate point. However, since (as mentioned above) I have
yet to see a solution for the layout I'm looking for (and which is
quite common - used on html5doctor.com for example) without using a
container element of some kind, I need to have one and I need to call
it something. I could call it "meaningless"...

> I do often use the w3c aria landmark role values as class values
> http://www.w3.org/TR/wai-aria/roles#landmark_roles

I like this idea, although the available roles don't seem that useful.

> Additionally it might be an idea to check RDFa and f.ex. dublin core for
> more useful class names.

Unfortunately I haven't found examples of RDFa or Dublin Core being
used to add semantics to structure.

In conclusion I don't think there does exist a standard for
ordering/structure of container elements, and it seems that's probably
a good thing. I do agree that it would be nice if I could eliminate
"container" elements, so I'm now going to try to work out how to do
that.


More information about the microformats-discuss mailing list