To <!DOCTYPE> or not to <!DOCTYPE>
I've been reading Jeffrey Zeldman's "Designing with Web Standards" and loving what he says about the wisdom of us crawling out of our Neanderthal caves -- designing pages with all the streamlining allowed by current CSS capabilities; designing for "modern" browsers instead of doing all sorts of "illegal" and laborious contortions with HTML in order to trick dinosaur browsers like Netscape 4 into displaying things they way we want them to appear.
He makes such a good case for separating Structural elements from Presentational elements -- confining Structure to HTML and Presentation to CSS....and simply ACCEPTING that our work will not look as good in the dinosaur browsers!
So, feeling totally liberated of the Neanderthal mentality I've been carrying for so long, I started making pages in XHTML, as he recommends in the book. I was loving it, and the pages looked great (in IE6), and they even validated in the W3C validator (I'm sure these are the only pages I've ever made that would even come close to doing that!). And then I noticed that my custom scrollbar had suddenly disappeared, replaced by the default version.
After checking and re-checking all my code and finding nothing out of place, I now discover that custom scrollbars are ILLEGAL in XHTML!!
I was using the <!DOCTYPE> and <html> tags below....
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
....and wondered what would happen if I removed the <!DOCTYPE> tag and kept the <html> tag. Guess what - the page displayed properly, even retaining the custom scrollbar.
Then I removed even the reference to XHTML from the <html> tag -- leaving an old-fashioned, basic <html> tag -- and still the page displayed properly, including custom scrollbar!
So, it seems, we CAN do custom scrollbars in XHTML, as long as we don't tell the browser we're using XHTML!
After all this, I have 2 questions:
1) Is there no problem using the basic <html> tag when the page is actually written in XHTML? (Apparently the / to close image tags, etc. is simply ignored by HTML...?)
2) Isn't the <html xmlns="http://www.w3.org/1999/xhtml"> tag, by itself, subjecting the page to the rules of XHTML? (Apparently not, since it allows the custom scrollbar to be displayed...)
Thanks in advance for your wisdom ------
_||_
db
|