[whatwg] <CENTER>, <MENU>, <DIR>, <NL>

Eugene T.S. Wong lists.eugenetswong at gmail.com
Mon Jan 16 16:02:31 PST 2006


On Sun, 15 Jan 2006 06:18:46 -0800, Anne van Kesteren  
<fora at annevankesteren.nl> wrote:

> Quoting "Eugene T.S. Wong" <lists.eugenetswong at gmail.com>:

>> <DIV> is  no more semantic that <I>, <B>, or <CENTER>, yet they
>> have their uses.
<snip>
>> I believe that they are useful for visual user agents, in that we  
>> don't  have to provide a class name for simple uses. Generally  
>> speaking, <CENTER>  should be used sparingly, if at all, but it should  
>> be used. <CENTER> could  be used for resume headings and various other  
>> types of text, like peotry.
>
> What would its semantics be as opposed to <div>? Do you have a concrete  
> proposal
> as how <center> would work?

I don't think that it is semantic at all. It's just that sometimes it  
would save us some hassles of having to type:

<style>
#intro{text-align:center}
</style>

<div id="center">blah blah blah</div>

I'd much rather type:
<center>blah blah blah</div>

Currently, images aren't allowed as children of <BODY>, which kind of  
makes sense if I understand correctly. I don't know about <OBJECT>, and  
I'm kind of lazy right now. :^) So if we were creating a document that  
isn't a child of a paragraph, then we could do:

<CENTER><IMG SRC="asdf" ALT="qwe"></CENTER>

The same could be done for text as well. I was doing a mission statement  
for an organization. This mission statement was created with the text  
being centered. It could be done with <DIV> and stylesheets but I'm not  
certain that it should be, because I believe that the markup should convey  
that this is the way that it is for a reason. It isn't just design. In  
this case, the markup should convey that the mission statement was always  
this way or should be this way by default.

Another example is computer game instructions. There are a lot of Atari  
fans out there still, and they may be interested in viewing game  
instructions online. The default rendering of the HTML should be exactly  
like the original manuscripts as much as possible. That isn't to say that  
the original manuscripts were designed properly. The idea is to preserve  
the original manuscripts as much as possible for historical value and  
enjoyment.

I understand the concept of stylesheets to be something that alters the  
default presentation. For example, we don't display tables as a bunch of  
inline text. We display it with a default of "display:table", etc. If we  
had implemented stylesheets from the beginning and encouraged them to use  
<DIV>s instead of <TABLE>, then people would be accustomed to using  
"display:table", but what good is it? Isn't it more convenient to have  
default stylings? As far as I understand, default stylings are supposed to  
be an amazing feature. That is why blind readers are able to do powerful  
things with tables.

I'm hoping that <CENTER> could get some kind of non-semantic use in the  
same way that <I> and <B> do, and the way that <TABLE> gets semantic use.

Another good use of <CENTER> is poetry or introduction pages, where there  
isn't a lot of text, and it looks much nicer when it is centered by  
default. I suppose that in this situation, I am getting very close to  
making tag soup, and to encouraging bad coding habits, but it doesn't have  
to be that way.

In the past, people typically did something like this:

<P><CENTER>ASDF ASDF</CENTER></P>

where there were no anonymous boxes, and there was no semantic value added  
by the <CENTER> element. What I'm proposing is supposed to encourage the  
use of <P> and stylesheets when the text is a paragraph that needs center  
alignment, and the use of <CENTER> when it is a div that needs center  
alignment. It's there to *replace* non-semantic and structural elements in  
specific contexts, not to add to create tag soup, and not to replace  
semantic elements.

The thing is that anything that really requires center alignment is most  
likely an uncommon type of text, so it would require a class or some  
selector. Since we already have this type of an element, then why not use  
it?



>> I'd like to recommend that the WHATWG bring back <MENU> & <DIR>,
>
> <http://whatwg.org/specs/web-apps/current-work/#the-menu>
>
> I have not seen <dir> and I'm unsure what it could be used for...

I think that I saw it in an old spec, or an old book. It's definitely not  
a WHATWG thing.

<DIR> could be used for listing files. If you want to print out the files  
of a directory and its subdirectories, then you could do that with <DIR>.  
I'm fairly certain that that was the original intent. For example:

<DIR ID="/home/eugene">
  <LI>.bashrc</LI>
  <LI>resume</LI>
  <LI>CoverLetter</LI>
  <LI>photo_me_medium.jpg</LI>
  <DIR ID=".kde">
   <LI>asdf</LI>
   <LI>qwer</LI>
   <LI>zxcv</LI>
  </DIR>
  <LI>foo.html</LI>
</DIR>

which could be rendered as:

/home/eugene
|- .bashrc
|- resume
|- CoverLetter
|- photo_me_medium.jpg
|- .kde
|  |- asdf
|  |- qwer
|  |- zxcv
|- foo.html

or it could be rendered as

/home/eugene/.bashrc
/home/eugene/resume
/home/eugene/CoverLetter
/home/eugene/photo_me_medium.jpg
/home/eugene/.kde
/home/eugene/.kde/asdf
.
.
.
etc.

Generally speaking, this would probably be used by application  
developers/designers, more than web page developers/designers. Opera  
allows us to browse our own hard drives, and I'm sure that all/most other  
browsers do also.

Also, this could be used by instruction manual writers. They could say,  
"This manual includes the following pages and can be found on  
www.foo.com.".

The good thing about this, is that even if a browser decides to not render  
the items in the manner that I've demonstrated, it could still present the  
information in an understandable way. All the browsers would have to do is  
use bullets. The context should give a hint as to what is what.

Actually, now that I think about it, non-compliant browsers wouldn't  
display ".kde" in the example, but I think that that is just a detail that  
could be worked out. Perhaps instead of using ID, we could just code it in  
a similar manner:

.
.
.
<LI>.kde
  <DIR>
  <LI>ASDF</LI>
.
.
.

where the directory name is just an anonymous box.

> I could not find <NL> (or <nl>) in any XHTML recommendation. I also never
> encountered it anywhere as actually being used, only in some examples  
> taken
> from the XHTML 2.0 draft...

Yes, the draft is where I got it from. I hope that I didn't  
miscommunicate. It's just that I'm not accustomed to using "draft" &  
"recommendation" for these discussions. I'm accustomed to thinking in  
terms of "standard" & "non-standard". I'm working on it, though. :^)

Does that clarify things?

-- 
Sincerely, and with thanks,
Eugene T.S. Wong



More information about the whatwg mailing list