[thelist] Doctype

Joel Stevenson joelstevenson at mac.com
Sun Feb 23 14:02:01 CST 2003


On Friday, February 21, 2003, at 12:48  PM, Chris Evans wrote:

> I understand that different browsers render differently using different
> DOCTYPEs, notable IE6 and Quirks mode.  What I can't seem to figure out
> are examples of code that would display differently.  If I use a Strict
> DOCTYPE, what sort of things would show up differently in browsers than
> using transitional or even no DOCTYPE declaration?
>

Things like using images for layout and placement are rendered
differently:

<table cellpadding="0" cellspacing="0" border="0">
<tr>
   <td height="1" colspan="3" bgcolor="#000000"><img src="spacer.gif"
width="1" height="1" alt=""></td>
</tr>
<tr>
   <td width="1" bgcolor="#000000"><img src="spacer.gif" width="1"
height="1" alt=""></td>
   <td> stuff here </td>
   <td width="1" bgcolor="#000000"><img src="spacer.gif" width="1"
height="1" alt=""></td>
</tr>
<tr>
   <td height="1" colspan="3" bgcolor="#000000"><img src="spacer.gif"
width="1" height="1" alt=""></td>
</tr>
</table>

without a doctype or with a transitional (4.01) doctype the above code
draws a 1px black border around the 'content' table data cell;  whereas
with a doctype of strict the top and bottom 'borders' end up much
thicker because the browser (I believe) is applying the default
line-height to the content of those cells.  Just one example that pops
into mind.

For Mozilla, the list of differences is available at
http://www.mozilla.org/docs/web-developer/quirks/quirklist.html

-meretal




More information about the thelist mailing list