Forum Moderators: open
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
because with that my css code to get a max width in IE doesn't work.
I've used
width:expression(document.body.clientWidth > 825? "800px": "auto" );
the max width works fine in firefox or netscape but I have to have the fix for IE.
My question is this. Does it really matter that much if the "http://www.w3.org/TR/html4/loose.dtd" is in there?
I really don't want to give up the max width.
if you actually go to the page
[w3.org...]
you'll see why.
it basically contains the instructions.
theoretically you could write your own doctype and as long as you put it in a publically accessable place browsers could use it.
If anyone can state one single cogent reason for spending time devising an alternative solution that may involve conditional comments and/or javascript and browser-sniffing, I will be utterly astonished.
Kaled.
Using the full doctype is good practice when building new designs, as it ensures a standards-compliant rendering mode in the browser, making it much easier to get CSS to work the same cross-browser. On old pages which still depend on tables for layout, "what works" is usually more important. :)
theoretically you could write your own doctype and as long as you put it in a publically accessable place browsers could use it.
Browsers don't actually read DTDs at all, the doctype URL is there for the validator only. The only effect of the doctype in the browser is to action the rendering mode switch.
I've been reading a lot about usability and by setting the max width my articles can be read comfortably even on a very large screen. Using a fix width means I have to make it narrow enough for 800x600 which looks really lost on a large screen.
Anyway I will go without the link for now. Thanks everyone for your input.