HTML validation headaches

liunx

Guest
I don't know what the anti-heaven I'm doing wrong. <br />
<br />
At the top of each page I have:<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br />
<br />
That's correct, right?<br />
<br />
Later, down the page, I have, for example:<br />
<br />
<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" bgcolor="#d9e0f0" background="bg.gif"><br />
<br />
Yet when I use the W3C Validator (<!-- m --><a class="postlink" href="http://validator.w3.org/">http://validator.w3.org/</a><!-- m -->), I get:<br />
<br />
Error: there is no attribute "LEFTMARGIN" for this element (in this HTML version). <br />
<br />
This happens under HTML 4.01 Transitional, 3.2 and 2.0. I thought leftmargin etc was supported by these HTML versions, so WTF?!<br />
<br />
Originally I had missed " and #, but including those it still doesn't validate! WHY?<br />
<br />
I also get this sort of thing with:<br />
<br />
<table width="770" height="100%" cellspacing="0" cellpadding="0" border="0"><br />
<br />
Error: there is no attribute "HEIGHT" for this element (in this HTML version)<br />
<br />
This is driving me nuts! Validate, schmalidate.<br />
<br />
[Edited to correct typo.]<!--content-->what it means is that the tags are depreciated and are not valid in that html version as it says it doesn't mean that your page will not work it just means that by the WC3's standards it is not 100% correct<!--content-->Even when I choose HTML 3.2 or 2.0 for validation, they're still deprecated? Incredible. I've read how it's SO important to have perfectly validated code, but as long as I close my tags and test in different browsers, I don't think I'll bother.<!--content-->marginleft etc were tags created for I Explorer and I Exploer only. When netscape and microsoft were slugging it out for web dominance. Now we are all left with this stupid legacy...<!--content-->I didn't know that. But why on earth would the height attribute in the <table> tag generate an error as well?<!--content-->w3.org thinks things like tags get old and the css way is a lot better. if you have to have a tag in your source that w3.prg doesn't like oh well. I use marginheigth and marginwidth for NS brwosers because they don't like margin attrib in css.<br />
<br />
if you have to use something to clear the margins then use <br />
<br />
<style><br />
body{margin: 0px;}<br />
</style><br />
<br />
and that will take care of IE, Mozilla and I believe NS6&7<br />
<br />
as far as the table attributes go, good luck. I have not found anything to get rid of cellpadding and cellspacing and height and align so I still use them. w3.org is real vague when it comes to deprecated tags and what to place them with.<br />
<br />
if you do use padding and margins then you risk a chance that the other 10 browsers won't work with them :P<br />
<br />
look how old that documentation is, 1999, and we can still use tags that are deprecated, so don't worry about the tags that are deprecated, just use them if you have to<!--content-->Scoutt is correct. These tags are proprietory extensions to the HTML code, working only in some browsers. Although I send most web page authors towards the Validator, the above echoes my thoughts exactly. The Validator can be used to check for errors on several levels. It can still be useful even if you aren't going to write fully compliant code. It will find other types of errors as well. This thread is also relevant: <!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&threadid=18300&pagenumber=1">http://www.htmlforums.com/showthread.ph ... genumber=1</a><!-- m --> as is this one: <!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&threadid=18312">http://www.htmlforums.com/showthread.ph ... adid=18312</a><!-- m --> .<!--content-->
 
Back
Top