Forum Moderators: open

Message Too Old, No Replies

What Doctype should I use? If any?

No DOCTYPE Found! Falling Back to HTML 4.01 Transitional

         

reweb

6:01 am on Jan 11, 2005 (gmt 0)

10+ Year Member



I am using an html validator and it is telling me I need a doctype on my webpages. My site is built with basic html and some CSS. Should I use this?

<!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!

reweb

6:06 am on Jan 11, 2005 (gmt 0)

10+ Year Member



By the way, I am using <FONT> tags and the <NOBR> tag....So I'm out of date I guess.

tedster

6:11 am on Jan 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You've made good choices to start - especially if you weren't creatng mark-up with any particular standard in mind.

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]

BonRouge

6:11 am on Jan 11, 2005 (gmt 0)

10+ Year Member



Stop using <font> tags and any other presentational mark-up in your html and do your styling with css.

Use this :


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">

Yes. It IS important.

reweb

7:10 am on Jan 11, 2005 (gmt 0)

10+ Year Member



Thank you for the replies.

I guess I will have to stop using font tags and the like eventually. I suppose I will continue on without a Doctype until I go to pure CSS. I sure don’t look forward to all of the work to change out the font tags and other outdated tags…

tedster

7:21 am on Jan 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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.

BonRouge

4:32 pm on Jan 11, 2005 (gmt 0)

10+ Year Member



As Tedster said, you're diggin' your own hole.