W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2011

[whatwg] wrapper element

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Sun, 27 Feb 2011 22:46:05 +0200
Message-ID: <56E061E7D2A24D21A07EC1DD40964334@JukanPC>
Bjartur Thorlacius wrote:
[quotation reorganized by me]

> On 2/27/11, usuario <soyhobo at gmail.com> wrote:
>
>> Tiis may seem somewhat silly, every front-end developer have ever
>> used a a wrapper div, shouldn't it be more semantic to have a
>> wrapper element?
>
> If said wrappers don't have any semantics but grouping loosely related
> elements, for which no semantic container exists, div seems
> appropriate.

I guess you mean a group that is not best describable as <nav> or <footer> 
or <section> or some of the other semantic elements. The most obvious 
candidate is the "content proper", as people often use, mainly for styling 
purposes, grouping together any content that is not a header, a navigation 
block, or a footer. In some cases, you might make it <article> or <section>, 
but if those don't apply naturally, it should be <div>. It is better to be 
semantically empty than to be semantically wrong, or even bordeline.

> What semantics would such an wrapper element provide over <div>? I'd
> rather discourage, and provide alternative features to wrapping.
> Providing another element for that purpose goes against that.

Thinking purely logically (if we dare), <wrapper> would have the benefit of 
explicitly saying "this is a wrapper for grouping, for no semantic reason", 
thereby distinguishing it from <div> which may, and often does, involve 
semantic or logical grouping. For example, <div id="footer"> is probably a 
footer of some kind, not arbitrary grouping.

But thinking pragmatically, it is difficult to see strong reasons to 
distinguishing wrappers from legacy use of <div>. Moreover, I don't think 
people would use <wrapper> much, since they can use <div> and are accustomed 
to <div>.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 
Received on Sunday, 27 February 2011 12:46:05 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:04 UTC