2004-07-25

Doesn't “display” Imply Appearance?

There's an issue about HTML that has been bothering me lately. Standards supporters have been stressing for a long time that website developers separate the content of a page from its presentation. The content could be in the HTML, symantically marked up, and the presentation should be written in stylesheets. However, the guys at the World Wide Web Consortium seem to insist that the display property of elements in part of the content of a page, and not purely the presentation.

If you validate the HTML of a webpage with a div inside of a span, you'll get an error saying that block-level elements may not be placed inside of inline elements. The difference between block-level elements and inline elements is how they are displayed visually. There is no implied symantic meaning behind them. The reason block-level elements aren't allowed inside inline elements is that you can't render it visually. You can't present it visually.

If you ask me, the HTML validator should ignore this issue entirely. Instead, the CSS validator should analyze the markup and apply the implied display property values to check whether or not they are valid in context.

Of course, that's assuming that they feel that the elements' displays are purely presentational, which doesn't seem to be the case. XHTML 2.0 makes this obvious. The developers have made it clear that it isn't supposed to be at all backwards compatible, giving them complete freedom to design the language from scratch, yet they have specifically added two pairs of elements that differ only in their display properties. blockcode and blockquote are exactly the same as code and quote, except that they are meant to be displayed as blocks instead of inline. It says that in blockcode, the whitespace in the included text has symantic relevance, but I really don't see why you can't just use a combination of code and pre, which would have the same symantic meaning. The World Wide Web Consortium describes XHTML 2.0 as A modularized language without presentation elements [Source].

I really don't believe that the World Wide Web Consortium has it right here. I'm fairly confident that sometime in the future they will realize that they made a mistake, and it will be difficult to correct it. Keep in mind that XHTML 2.0 is still in development, although I don't see any signs that blockcode and blockquote may be removed.

0 comments

Post new comment

Comment moderation policy: Your comment will be reviewed before it is added to the site. This is in response to spam and other forms of abuse. I gladly accept comments containing criticism as long as the language is clean.

This weblog is powered by Blogger.