paulc12@mindspring.com Posted August 24, 2010 Report Posted August 24, 2010 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. Quote
falkencreative Posted August 24, 2010 Report Posted August 24, 2010 The standard ones that most people use are HTML4 Strict, XHTML strict, and HTML5. Since XHTML is being phased out in favor of HTML5, and HTML5 isn't fully supported by browsers yet, I usually suggest going with HTML4 strict. more info: http://www.w3.org/QA/2002/04/valid-dtd-list.html Quote
Wickham Posted August 24, 2010 Report Posted August 24, 2010 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. Quote
newseed Posted August 24, 2010 Report Posted August 24, 2010 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. Quote
virtual Posted August 24, 2010 Report Posted August 24, 2010 Like Newseed said you can change the Doctype for new documents, in CS4 it is probably the same as in CS3, just go to Preferences - New Document and change the Doctype you want. Quote
paulc12@mindspring.com Posted August 24, 2010 Author Report Posted August 24, 2010 Thank you everyone for the helpful advice, the links, and quick responses. I am going to give the HTML 4.01 Strict a try and see how much trouble I can get into! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> Thanks again, Paul Quote
straightryder Posted September 24, 2010 Report Posted September 24, 2010 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. Quote
newseed Posted September 24, 2010 Report Posted September 24, 2010 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. Quote
Kyle Undefined Posted September 24, 2010 Report Posted September 24, 2010 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. Quote
newseed Posted September 25, 2010 Report Posted September 25, 2010 (edited) 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 September 25, 2010 by newseed Quote
Kyle Undefined Posted September 25, 2010 Report Posted September 25, 2010 Ah yes, you're right. Totally forgot that part about the declaration, thanks Quote
MaryD Posted September 28, 2010 Report Posted September 28, 2010 IE9 now fully support html5 and css3, so it will complain with w3c standards, as it does now. Quote
Wickham Posted September 29, 2010 Report Posted September 29, 2010 IE9 now fully support html5 and css3, so it will complain with w3c standards, as it does now. Not yet! IE9 is still beta and some important features don't work yet like border-image and text-shadow. See http://msdn.microsoft.com/en-us/library/cc351024%28VS.85%29.aspx Quote
newseed Posted September 30, 2010 Report Posted September 30, 2010 Also keep in mind that HTML 5 and CSS3 are still in beta. Although I don't think they will remove anything that most modern browsers are supporting now, it's possible that new tags or css elements could be added. Quote
Recommended Posts
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.