Jump to content

DOCTYPE Confusion!


paulc12@mindspring.com

Recommended Posts

The more I read about DOCTYPEs the more confusing it seems to me. There are a lot of opinions about it. I am redoing a website, all the html and getting into CSS farther than I ever have. Before I get too many webpages redone I want to determine once and for all which DOCTYPE I should use. I am using Dreamweaver CS4 and noticed if I create a new HTML document using one of the default templates, here is the DOCTYPE that is included;

 

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

 

One opinion I read said Dreamweaver plugs in a good DOCTYPE to use. I have no idea whether that is true or not. The website is not going to be super fancy or very technical, I mainly just want solid HTML and CSS. I would like to be able to successfully validate the HTML. So which DOCTYPE does everyone recommend? Is there an agreement on which one would be best? I appreciate any help on this. Thanks.

Link to comment
Share on other sites

It's a big debate, HTML or XHTML.

 

Here's a lot to read:-

http://www.wickham43.net/generaladvice.php#xhtml

 

A few years ago people thought that XHTML was going to supersede HTML so they converted to XHTML 1.0 but then the people that create these standards decided that XHTML should be "pure" and not used for normal websites, just for special SVG and MathML sites. Pure XHTML with content="application/xhtml+xml" (instead of content="text/html; charset=utf-8") will not display if there is the smallest error and not in IE6 even if correct.

 

Start using HTML 4.01 Strict but if it doesn't validate error-free you may need to use Transitional because certain deprecated tags will still validate with Transitional.

Link to comment
Share on other sites

You can alter the default Doctype to have it load the HTML 4.01 Strict every time you start a new page by editing the configuration file(s) for Dreamweaver.

 

The following is based on Dreamweaver 8 (outdated) which is what I use to use:

 

Open Windows Explore and navigate to this folder:

 

../Macromedia/Dreamweaver MX/Configuration/DocumentTypes/NewDocuments/

 

If you are using Adobe version then it might read /Adobe/ instead of /Macromedia/

 

Open Default.html using Notepad. You will then be able to see the current Doctype. Just swap it out with HTML 4.01 Strict (copy and paste) and save it.

 

That's it.

 

And it's true that XHTML is going bye-bye but over time. HTML 5 will soon (in a few short years) become the norm if you want to code it using the new tags. Nevertheless, HTML 4.01 will still be a around for years until all modern browsers support the new HTML 5 and CSS 3 and that the old unsupported browser are no longer in extistence.

Link to comment
Share on other sites

  • 5 weeks later...

I been learning with strict for the past while now... yes its good if you really want to drive yourself mad but you learn a lot from it.

 

Validating is brutal but sooner or later you get the hang of it in some way shape or form.

 

Try strict out for a bit then move over to html 4.01. I'm considering 4.01 from now on im thinking.

Link to comment
Share on other sites

I been learning with strict for the past while now... yes its good if you really want to drive yourself mad but you learn a lot from it.

 

Validating is brutal but sooner or later you get the hang of it in some way shape or form.

 

Try strict out for a bit then move over to html 4.01. I'm considering 4.01 from now on im thinking.

This is the right approach to valid coding. Believe it or not, after doing this for a long while you start to become more proficient and accurate with your coding thus you hardly ever have the need to validate your code.

Link to comment
Share on other sites

Strict HTML/XHTML is always the best way to go, just provides better looking code if you are true to validating. Or, you could use HTML 5 "<html>" is all you need, that's what I use in my personal site.

Actually, you need <!DOCTYPE html> for HTML 5. Also, keep in mind that many of the new elements/tags that HTML 5 uses are not supported. Google Chrome is the closes thing that will render them. Firefox 3 and Safari seems to support only some of the new tags.

 

Same applies to CSS 3.

Edited by newseed
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...