On Wed, 14 Feb 2001, Joe Hewitt wrote:
>>
>> That page has absolutely no semantics whatsoever. It's like the opposite
>> of a good web page (as far as valid markup goes).
>
> I won't disagree with you.  I suppose, based on the content of the
> documents in question, I was setting myself up for criticism by
> designing for visual quality and clean html rather than structural
> integrity.

That's a common mistake. Designing a web page is often seen as a one step
process: create markup that matches the final look and then use CSS to
mold the markup into the look.

The "correct" way of writing a web page is a two stage process. First,
markup your content semantically -- e.g., use <h1> for the main header,
<p> for paragraphs, <ol> for numbered lists, <blockquote> for sections
that are quoted from another document and <cite> for titles of references
(citations).

Then, the second stage, is to write zero, one, or more stylesheets to mold
the structural markup into whatever shape you actually want it to have.

<div> and <span> are meaningless (literally) so they should almost never
appear in the markup -- exceptions are those where, for example, you want
more than one border to appear and the style language you use doesn't give
you enough flexibility to do so.

For example:

   <h1><span>This is my heading</span></h1>

...may be necessary if you are trying to style the background of the text
and the background of the block separately.

My canonical example for this is:

   http://www.damowmow.com/indexes/multiple.html

The main markup for that page is:

   <body>
    <h1><span>damowmow.com</span></h1>
    <h2><img src="http://www.hixie.ch/resources/images/astrophy/original"
             alt="" width="70" height="69"></h2>
    <p><a href="links.html">links</a></p>
    <p><a href="media.html">pictures</a></p>
   </body>

Play around with the alternate stylesheets on that page. Note that the
markup was not designed with any one look in mind -- it was written in a
purely structural manner.

-- 
Ian Hickson                                     )\     _. - ._.)       fL
Netscape, Standards Compliance QA              /. `- '  (  `--'
+1 650 937 6593                                `- , ) -  > ) \
irc.mozilla.org:Hixie _________________________  (.' \) (.' -' __________

Reply via email to