I was going to ask this question anyway, but then this thread started 
about the place of doctypes...

Patrick H. Lauke wrote:

> > If you know for sure that the markup is going to be invalid, why 
bother
> > with a doctype at all? ...

OK, Consider this very simple HTML document:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd";>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; 
charset=iso-8859-15">
  <title>Table CSS test: Doctype HTML4 transitional</title>
  <link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>

<p>Paragraph</p>

<table cellpadding=5 cellspacing=0 border=1>
<tbody>
  <tr>
    <td>Top-left</td>
    <td>Top-right</td>
  </tr>
  <tr>
    <td>Bottom-left</td>
    <td>Bottom-right</td>
  </tr>
</tbody>
</table>

</body>
</html>

With this extremely simple stylesheet (styles.css):

body {
        font-family: arial,verdana,helvetica,sans-serif;
        font-size: .7em;
}

In Safari, Firefox & IE5.2Mac, this page appears as expected: the text in 
the paragraph and the table are the same size. Increase/decrease the 
browser font size and they grow/shrink together.

Now delete the <!DOCTYPE ...> declaration and try again. This time, only 
the paragraph text follows the "body" style; the table text defaults to 
the browser's "normal" setting.

To save you from having to create the documents, here are the 2 versions:
 
http://www.artgallery.nsw.gov.au/sub/dev/doctype_test/doctype.html
http://www.artgallery.nsw.gov.au/sub/dev/doctype_test/no_doctype.html

How could leaving out the doctype make such a definite difference to such 
a simple page?

Regards,

Jonathan Cooper
Manager of Information / Website
Art Gallery of New South Wales
Sydney, Australia
http://www.artgallery.nsw.gov.au

[EMAIL PROTECTED] wrote on 02/10/2004 12:04:24 AM:

> 
> I've settled with using the XHTML Transitional doctype, but that's only 
for
> new documents. For your older documents which don't have correct syntax, 
I
> agree with the other posts. I wouldn't use a doctype at all and let the
> browser go into quirks mode and do it's best to render. Slapping an 
XHTML
> doctype on those documents won't make them more forward compatible, only
> fixing the HTML would. It could actually make those documents less
> compatible because you are in essence lying to the browser about the
> content, and then hoping the browser doesn't mess up the rendering. 
> 
> ... under what cases should one use
> an XHTML doctype - practically speaking ...
> 
> I would say simply, you should use XHTML doctype if you actually have 
valid
> XHTML code in your document.
> 
> With that said here's some resources I find helpful, if you'd like to 
dig
> more.
> 
> http://www.htmlhelp.com/tools/validator/doctype.html
> http://www.quirksmode.org/about/quirksmode.html
> http://www.alistapart.com/articles/betterliving/
> http://www.alistapart.com/articles/doctype/
> http://www.allmyfaqs.com/faq.pl?DOCTYPE
> 
> Chris
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of Nando
> Sent: Thursday, September 30, 2004 8:12 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [WSG] doctypes, quirks/standards mode and positioning
> 
> I'll be reworking the markup and the layout approach they've used ...
> it's just that i anticipate they'll have a reason for using the
> doctype ... cuz it doesn't jump up there by itself, that i'll need to
> intelligently and authoritively discuss with them. Much of the code is
> actually generated out of a Struts jsp app. So i'm looking for
> resources and experienced opinions ... under what cases should one use
> an XHTML doctype - practically speaking ...
> 
> On Thu, 30 Sep 2004 22:40:43 +0100, Patrick H. Lauke
> <[EMAIL PROTECTED]> wrote:
> > Neerav wrote:
> > 
> > > so go for html 4 transitional validation if the clients tables will
> > > always be invalid
> > 
> > If you know for sure that the markup is going to be invalid, why 
bother
> > with a doctype at all? It's a bit like putting a "may contain nuts"
> > sticker on a bag of peanuts...
> > 
> > Patrick H. Lauke
> > _____________________________________________________
> > re.dux (adj.): brought back; returned. used postpositively
> > [latin : re-, re- + dux, leader; see duke.]
> > www.splintered.co.uk | www.photographia.co.uk
> > http://redux.deviantart.com
> > 
> > 
> > 
> > ******************************************************
> > The discussion list for  http://webstandardsgroup.org/
> > 
> > Proud presenters of Web Essentials 04 http://we04.com/
> > Web standards, accessibility, inspiration, knowledge
> > To be held in Sydney, September 30 and October 1, 2004
> > 
> > See http://webstandardsgroup.org/mail/guidelines.cfm
> > for some hints on posting to the list & getting help
> > ******************************************************
> > 
> >
> ******************************************************
> The discussion list for  http://webstandardsgroup.org/
> 
> Proud presenters of Web Essentials 04 http://we04.com/
>  Web standards, accessibility, inspiration, knowledge
> To be held in Sydney, September 30 and October 1, 2004
> 
>  See http://webstandardsgroup.org/mail/guidelines.cfm
>  for some hints on posting to the list & getting help
> ******************************************************
> 
> 
> 
> ******************************************************
> The discussion list for  http://webstandardsgroup.org/
> 
> Proud presenters of Web Essentials 04 http://we04.com/
>  Web standards, accessibility, inspiration, knowledge
> To be held in Sydney, September 30 and October 1, 2004
> 
>  See http://webstandardsgroup.org/mail/guidelines.cfm
>  for some hints on posting to the list & getting help
> ******************************************************
> 


This e-mail message is intended only for the addressee(s) and contains 
information which may be confidential.  If you are not the intended 
recipient please advise the sender by return email, do not use or disclose 
the contents, and delete the message and any attachments from your system. 
 Unless specifically indicated, this email does not constitute formal 
advice or commitment by the sender or the Art Gallery of NSW  (ABN 24 934 
492 575) or its related entities.
******************************************************
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help
******************************************************

Reply via email to