Forum Moderators: open
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
I also have a couple of frames pages. Should I put this at the top of the Frameset pages?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
If not any suggestions? Is this really needed? Thanks!
When you use a complete or full doctype (including the URL for the DTD) then you switch modern browsers into Standards Mode. This can create a surprise in some areas if your mark-up was counting on Quirks Mode. It all depends on your layout - and you may not notice much if any difference in Explorer at any rate. Firefox, Opera, Safari often show more precise adherence to the W3C standards and this can break some layouts.
So I would suggest you understand Quirks Mode and Standards Mode [webmasterworld.com] going forward.
Is this really needed?
Well, browsers will render "something" if the DTD is not there. So in that most basic sense, no it's not needed - at least not today.
But if you take the time to get up to speed about this (and it's not that big a deal) you will find that your entire mindset evolves and development becomes an easier and more straightforward affair for you.
[edited by: tedster at 6:11 am (utc) on Jan. 11, 2005]
I sure don’t look forward to all of the work to change out the font tags
I know what you mean. But having recently done a redesign on a site that was originally created with this standards-based approach, and also one that was originally done with <font> tags and what I call "cowboy code", I can say that the standards based site was a WHOLE lot easier to deal with. Maintenance is a much sweeter deal, and sometimes it's nearly painless.
And you can do so much more with css than mere html tags, that this alone makes it worth learning.