Do I REALLY need a DOCTYPES, on my websites?

They have: 3 posts

Joined: Mar 2005

Do I REALLY need a DOCTYPES, on my websites?

I am trying to find some updated information about DOCTYPES. It seems everything I find is about 2-3 years old.

Do I really need to use a doctype? It seems people are pushing this so the websites can be validated, however I want to know if it is mandatory to have for today's Internet world or for the future?

The reason why I ask is because I have designed over 35 websites and all of them are live on the Internet with no doctypes, They seem to look great on all browsers, (IE, Netscape, Firefox, Mozilla) and I have never received a complaint about a site not working.

It seems that people are pushing doctypes because browsers are becoming stricter with the HTML language. My quess, because I cannot find any updated information on doctypes that this has already happened. And since my websites look good on all browsers, should I need to worry.

Thanks
Chad

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Short answer: yes.

Long answer: no, good browsers will dance around bad code, but this can be quirky. Not all browsers are good. Make life easier for everyone and code according to your chosen spec, and that means insert a doctype. Can't be that much trouble, can it? Smiling

Welcome to TWF. Smiling

Roo's picture

She has: 840 posts

Joined: Apr 1999

ALA article on Doctype

It IS important, so the browser knows which 'type' of html it's reading. Maybe it would be a lot of work to go back and bring all of your previous work into compliance, but in the future you should write valid code that validates, and that includes using the correct doctype declaration for either HTML 4.01 or XHTML.

You'll have no display issues or cross browser/cross OS issues this way.

Roo

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

The reason the browsers show up "fine" is because it is displayed in "quirks mode."

It is recommended that you include the doctype for reasons already mentioned above.

Busy's picture

He has: 6,151 posts

Joined: May 2001

In plain english; the DOC tag declares how the page should be rendered.
If there is no DOC tag the browser will put it in quirks mode which can be to the browsers specs (think of IE and Netscape's differences - scary), or if it has a DOC tag displays in strict mode which displays how you have coded it (if the browser understand/supports your tags)

They have: 3 posts

Joined: Mar 2005

I currently us FrontPage for designing websites. I also only design information websites such as landscaping business, construction companies etc.

Website that pretty much just give information about the business, (Home page, about page, services, gallery etc.) I am not creating any kind of database driven websites, just basic informational websites.

I also found out the Front Page does not use doctypes because:. "As with most modern Web development tools, FrontPage may use design-time proprietary code and attributes for HTML tags that does not validate according to the standards of the W3C"

If this is the case, am I, OK with creating standard Table layout websites with no doctype.

Is this going to become a problem in the future, or as long as my websites are working correctly on all browsers today, I should not have a problem for the future.

Thanks
Chad

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

perryc20 wrote: Is this going to become a problem in the future, or as long as my websites are working correctly on all browsers today, I should not have a problem for the future.

If you want the short answer, yes, it will become a problem for you in the future. Why? Go do some reasearch Sticking out tongue

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

perryc20 wrote: I also found out the Front Page does not use doctypes because:. "As with most modern Web development tools, FrontPage may use design-time proprietary code and attributes for HTML tags that does not validate according to the standards of the W3C"

This is not a good thing. Where did you get the quote, btw?

perryc20 wrote: Is this going to become a problem in the future, or as long as my websites are working correctly on all browsers today, I should not have a problem for the future.

In fact, a doctype is future-proof. You're precisely identifying what spec you're writing it against. If you didn't have a doctype, who knows, the browsers of 5 years later may by default try parsing your page as some form of XML or whatever is standards then. Wink

I've been assuming that you've written all your pages in valid code and have merely opted to not use a doctype. Seeing as you use Frontpage, I'd guess that you would need to do some work on making your code valid before setting a doctype. If you set a doctype and don't adhere to the given spec, things will break. If fixing that is going to be too much trouble, then just take Roo's advice: code properly, doctype included, from now on. Smiling

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Try running a validator to see what might be causing the problems. This is one good reason to use a doctype - the validators will be able to tell you what is wrong with your code. That said, MS is probably putting a lot of crap in there that other browsers don't understand when rendered under a certain specification (doctype).

perryc20 wrote: I also found out the Front Page does not use doctypes because:. "As with most modern Web development tools, FrontPage may use design-time proprietary code and attributes for HTML tags that does not validate according to the standards of the W3C"

Ha ha ha ha ha ha ha ha. That's hilarious. The quote, I mean, I'm not laughing at you. Laughing at whoever wrote that. It's a complete load of crap. You really ought to stop using FP and start using a tool that can design according to the specifications. And, contrary to what that quote says, other tools DO use standard coding procedures and do not put in proprietary crap that doesn't validate.

Quote: If this is the case, am I, OK with creating standard Table layout websites with no doctype.

You should also know that tabled layout sites are no longer 'standard'.

Here are some references on why to use standard coding procedures:

http://www.webstandards.org/learn/faq/#p3
http://www.alistapart.com/articles/netscape/
http://www.nypl.org/styleguide/

All of those are excellent sites that you may want to look at more thoroughly.

They have: 3 posts

Joined: Mar 2005

I did what everyone said, and I added a Doctype to one of my pages to see what happens,

Doctype:

However when I upload the new page and looked at it on different browsers, the layout was distorted, (Margins, table etc.)

What happened? If I use a doctype it messes up the websites, If I don't use a doctype it looks great on all browsers.

Also how do I know what doctype to use, I create websites in Front Page and it handles all of the HTML coding.

Thanks
Chad

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.