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

siegfried siegfried at rorkvell.de
Thu Apr 19 01:38:18 PDT 2012

Am 30.12.2011 04:24, schrieb Robin Winslow:

> 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"...

Sorry for answering that late. Since january i have a new job and too
much to work and too less time :)

So, if you need a "meaningless" container, just beeing a "container" of
no other meaning than beeing a container, then a div without any class
would be correct.

If you need to style it, just use body > div

But if you just use the body element for styleing, this would make such
a wrapper container obsolete. You might want to assign margin oder
padding to the body.

There is just one thing to mention: body is different in meaning in html
and xhtml. In html, it is the root element and as such, any styling of
the body impacts the whole page/viewport. In xhtml, the html element
instead is the root element. Any styling of the body only impacts
everything the body covers. If f.ex. the body only contains 1 word, and
you would set background-color to black, in xhtml this would only set
the background color of this single word to black. In html this would
set the whole viewport background to black. So if you have a
background-color other than white it makes a difference if you use
margin or padding. The margin does not get the background color, the
padding does.

BTW: xhtml sent as text/html is no xhtml, but slightly buggy html!


More information about the microformats-discuss mailing list