W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2007

[whatwg] additional empty elements

From: Brenton Strine <Brenton.Strine@citrix.com>
Date: Tue, 1 May 2007 12:21:20 -0700
Message-ID: <055CEE9BBB05EC4090F8C7515DCB362D03031818@sbapexch01.ad.corp.expertcity.com>
I would like to know what other people think about
creating more empty elements in HTML5.

Say, for example, you have a website which has sections
of content that are indented variously. It would be easy
to accomplish the different styles using classes:

<div class="firstgroup">This text isn't indented at
all!</div>
	<div class="secondgroup">This text is indented a
little.</div>
		<div class="thirdgroup">Lots of
indentation.</div>
<div class="firstgroup">No indentation here!</div>

However, if I then wanted to add additional special
styling to the first and third div, (e.g.. a border and
background color) it is less graceful. I could add style
attributes, but that would be wasteful if I want to do
this on a large scale. Multiple classes would be
confusing. 

A nice solution would be the addition of a few div tags.
(e.g. <div2>, <div3>, <div4> and <div5>.) Then you could
do something like this:

<style>
div1 {text-indent:0px;}
div2 {text-indent:10px;}
div3 {text-indent:20px;}
</style>

Then:

<div1>This text isn't indented at all!</div1>
	<div2>This text is indented a little.</div2>
		<div3>Lots of indentation.</div3>
<div1>No indentation here!</div1>

This is much more human-readable, and the addition of
additional styles is now elegant and easy with the use of
classes.

<div1 class="bluestyle">This text isn't indented at
all!</div1>
	<div2>This text is indented a little.</div2>
		<div3 class="redstyle">Lots of
indentation.</div3>
<div1>No indentation here!</div1>

 I also think that it would simply be easier to write
code if there were a few extra non-semantic empty tags.
HTML5 needs improvements that will make people want to
use it. Making it easier to code than HTML 4 will ensure
a quicker and wider acceptance.

I am okay with the unimaginative numbering of the extra
elements, as it would make it easy to have a lot of new
elements. However, there are countless possibilities:
<section>, <chunk>, <partition>, <block>, <enclosure>,
<zone>, <figure>, <sector>, <quadrant> etc...

Are there other people who have found themselves wishing
for another <span> or <div>-like tag?


Brenton Strine
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20070501/190c1071/attachment.htm>
Received on Tuesday, 1 May 2007 12:21:20 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:55 UTC