How do I know what DOCTYPE to set?

liunx

Guest
Currently, the pages I'm working on have:<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><br />
at the top, but I'm getting a validation error which I'm being told is due to the wrong !DOCTYPE being used. I am getting the error messages:<br />
<br />
<br />
Line 17, column 89: there is no attribute "BORDERCOLOR" (explain...). <br />
...ding="0" cellspacing="0" bordercolor="#0099CC"><br />
^<br />
Line 18, column 37: there is no attribute "BACKGROUND" (explain...). <br />
<tr><td bgcolor="#006699" background="logos/titlelogo.jpg" height="90"><img src=http://www.htmlforums.com/archive/index.php/<br />
<br />
:confused:<!--content-->Here you can find out about the different doctypes for HTML (<!-- m --><a class="postlink" href="http://www.w3schools.com/html/html_whyusehtml4.asp">http://www.w3schools.com/html/html_whyusehtml4.asp</a><!-- m -->) and XHTML (<!-- m --><a class="postlink" href="http://www.w3schools.com/xhtml/xhtml_dtd.asp">http://www.w3schools.com/xhtml/xhtml_dtd.asp</a><!-- m -->)<br />
<br />
Now for your errors... bordercolor and background are deprecated attributes of HTML 4.01. Just searched google and found this (<!-- m --><a class="postlink" href="http://www.loc.gov/iug/html40/40tags.html#dep">http://www.loc.gov/iug/html40/40tags.html#dep</a><!-- m -->) on deprecated tags and attributes.<br />
<br />
HTH<br />
<br />
EDIT: one more link (<!-- m --><a class="postlink" href="http://www.w3.org/TR/REC-html40/struct/global.html#h-7.2">http://www.w3.org/TR/REC-html40/struct/ ... html#h-7.2</a><!-- m -->) to the w3c for doctypes for HTML!<br />
<br />
EDIT: a link to the w3c for deprecated tags (<!-- m --><a class="postlink" href="http://www.w3.org/TR/REC-html40/appendix/changes.html#h-A.3.1.2">http://www.w3.org/TR/REC-html40/appendi ... #h-A.3.1.2</a><!-- m -->) and here a list of attributes (<!-- m --><a class="postlink" href="http://www.w3.org/TR/REC-html40/index/attributes.html">http://www.w3.org/TR/REC-html40/index/attributes.html</a><!-- m -->) where you can find out which are deprecated!<!--content-->those errors don't mean wrong doctype, they are just what karinne said, deprecated tags or tags that don't belong there.<!--content-->Thank you! I love you!<!--content-->Originally posted by LeftHandGuitar <br />
Thank you! I love you! <br />
<br />
hmmm... Don't tell my fianc? :D<!--content-->The minimum required is:<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br />
<br />
<br />
<br />
Validation:<br />
You tell the validator (<!-- m --><a class="postlink" href="http://validator.w3.org/">http://validator.w3.org/</a><!-- m -->) what version of HTML you are using, and it checks that your code follows the rules for that version of HTML.<br />
<br />
It finds typos and misspellings of tags and attributes, wrongly nested tags, tags opened but not closed, or closed in the wrong order, attribute values that are not allowed and so on.<br />
<br />
It will also point out where you used tags and attributes that are not in that particular version of HTML. Some of these tags are browser specific code, like <blink> and <marquee>, so these tags do work in some browsers, but are flagged as errors by the validator, as you are better off using some other method, like CSS, for the effect.<!--content-->
 
Back
Top