[WEB4LIB] Re: testing style sheets (css) and proper DTD

Thomas Dowling tdowling at ohiolink.edu
Fri Jan 4 12:50:18 EST 2002


> >1. Is there a website to test my css style sheet against?
> >2. What is the DTD code that should be in my web pages to take full
> >advantage of  CSS?  I had it once but lost it.


>In any case, it is my understanding that the DTD you use has less to do
>with "taking full advantage of CSS" than it does with ensuring that the
>browser uses the appropriate CSS rendering engine.  (Pardon me if my
>terminology isn't quite accurate.)


This pretty much sums it up.  Both Microsoft and Mozilla are pulled in two 
directions: on the one hand, they know they have to support the standards; 
on the other hand they have to continue rendering pages as expected, even 
when those pages were created around the non-compliant behavior of other 
browsers.  Both IE (5+ on the Mac side, 6+ on Windows) and Mozilla use the 
dubious technique of "doctype sniffing" to decide which behavior to use.

Microsoft documents their sniffer at 
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnie60/html/cssenhancements.asp>. 
Mozilla's information is at 
<http://www.mozilla.org/docs/web-developer/quirks/doctypes.html>.  To the 
best of my knowledge, Microsoft switches CSS behavior only, while Mozilla 
switches some HTML behavior.

For both browsers, the DOCTYPE you specify may be less important than the 
exact way you do it.  For the purposes of validating HTML, you can specify 
HTML 4.01 Transitional with or without the DTD's URL in the DOCTYPE.  For 
IE6, though, you get standards mode if you include the URL, and bugs mode 
if you leave it out.


Thomas Dowling
OhioLINK - Ohio Library and Information Network
tdowling at ohiolink.edu



More information about the Web4lib mailing list