DTD Help

liunx

Guest
What determines what Document Type Declaration is appropriate?<!--content-->The markup structire you use to make the page. If you use HTML, I would suggest starting with HTML 4.01 tramsitional.<br />
<br />
MNS<!--content-->HTML 4.01 Trans is for wussies! :p I would recommend at least XHTML 1.0 Trans if not XHTML 1.0 Strict. Why? Because the rules for XHTML actually make your code cleaner and easier to look at. You can make some valid HTML 4.01 Trans code that could still be so messy it spins my head, but XHTML forces you to obey certain rules. Plus, even Blogger has made it's templates XHTML 1.0 Trans. Why strict? Because it futher helps in cleaning up code and forces people to stop using things like <font> tags. Say what you want about browser support for CSS, but defining things like font sizes and what not is universally supported.<!--content-->The DTD defines what (x)html element are available, not the other way around. :D<br />
<br />
<!-- m --><a class="postlink" href="http://www.w3.org/QA/2002/04/valid-dtd-list.html">http://www.w3.org/QA/2002/04/valid-dtd-list.html</a><!-- m --><!--content-->His page happens to be coded in HTML and for simplicity, without haveing to make major changes, a HTML 4.01 transitional is the best and quickest way to get a doctype on his page and valid code.<br />
<br />
MNS<!--content-->As has been mentioned above, your document type declaration should reflect the version of HTML that you are using. <br />
<br />
HTML 3.2 (<!-- m --><a class="postlink" href="http://www.w3.org/TR/REC-html32">http://www.w3.org/TR/REC-html32</a><!-- m -->) is what most people mean by HTML. Documents written in HTML 3.2 will look the same on all graphical browsers. However, they tend not to work on non-graphical browsers. And it is important that visually impaired persons have access to the web.<br />
<br />
HTML 4.01 (<!-- m --><a class="postlink" href="http://www.w3.org/TR/html4/">http://www.w3.org/TR/html4/</a><!-- m -->) Strict, if you follow the specification and not just the DTD, will give you a document that will work on all browsers but will not look exactly the same on all graphical browsers.<br />
<br />
HTML 4.01 (<!-- m --><a class="postlink" href="http://www.w3.org/TR/html4/">http://www.w3.org/TR/html4/</a><!-- m -->) Transitional was written as a transitional step between HTML 3.2 and HTML 4.01 Strict. If you start with a page in HTML 4.01 Strict and then add the HTML 3.2 specific stuff you can end up with a page that works on all browsers and looks the same on all graphical browsers. Most all documents in HTML 4.01 transitional, however, neither work on all browsers nor have a consistent look. It's the worst of both worlds. <br />
<br />
HTML 4.01 (<!-- m --><a class="postlink" href="http://www.w3.org/TR/html4/">http://www.w3.org/TR/html4/</a><!-- m -->) Frameset is for use with framesets.<br />
<br />
XHTML 1.0 (<!-- m --><a class="postlink" href="http://www.w3.org/TR/xhtml1/">http://www.w3.org/TR/xhtml1/</a><!-- m -->) is nothing more than an XML version of HTML 4.01. If, but only if, you follow the guidelines in Appendix C (<!-- m --><a class="postlink" href="http://www.w3.org/TR/xhtml1/#guidelines">http://www.w3.org/TR/xhtml1/#guidelines</a><!-- m -->) of the specification it will look like HTML 4.01 to older browsers.<br />
<br />
XHTML 1.1 (<!-- m --><a class="postlink" href="http://www.w3.org/TR/xhtml11/">http://www.w3.org/TR/xhtml11/</a><!-- m -->) is XHTML 1.0 Strict with the DTD organized differently.<br />
<br />
Use, therefore, HTML 4.01 Strict, XHTML 1.0 Strict or XHTML 1.1.<!--content-->
 
Back
Top