Page 1 of 1

W3C HTML Validator

Posted: Sun Sep 05, 2004 11:20 pm
by anjanesh
I was trying out W3C's Validator and returned more than 100 invalid tags.
<BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0>
does not seem to be acceptable.
Hows that when all browsers are accepting it ? Isnt this a valid tag ?
there is no attribute "LEFTMARGIN"
and same for rest 3.
How else can we define the margin positions of the document body ?

Posted: Sun Sep 05, 2004 11:27 pm
by feyd
with CSS.. the way you are supposed to for, oh, the last 4 years. ;)

Posted: Sun Sep 05, 2004 11:35 pm
by anjanesh
Im trying to have the page pass through the validator error free.
And what abt Javascript ? It doesnt seem to be parsing Javascript because this is what I did :

Code: Select all

<SCRIPT LANGUAGE=Javascript TYPE="text/javascript">
var ScreenWidth=screen.width,allowedWidth;
if (ScreenWidth>=1000) allowedWidth=1000; else allowedWidth=780;
document.write('<TABLE BORDER=0 WIDTH='+allowedWidth+' ALIGN=center>');
</SCRIPT>
<NOSCRIPT>
<TABLE BORDER=0 WIDTH=780 ALIGN=center>
</NOSCRIPT>
<TR><TD>etcetc</TD></TR>
gives a lot of errors :

"TABLE" not finished but containing element ended
</NOSCRIPT>
end tag for "TABLE" omitted, but its declaration does not permit this
</NOSCRIPT>
start tag was here
<TABLE BORDER=0 WIDTH=780 ALIGN=center>
document type does not allow element "TR" here
<TR><TD>etcetc</TD></TR>

Posted: Mon Sep 06, 2004 12:06 am
by feyd
from what I remember, Javascript is ignored by html validators.

Posted: Mon Sep 06, 2004 12:10 am
by d3ad1ysp0rk
When dynamically creating a tag based on JS, you won't validate correctly.
Because all it sees is:
<noscript>
<table blah blah>
</noscript>

which is invalid.

Posted: Mon Sep 06, 2004 1:43 pm
by anjanesh
Im slowly getting this to work out.
1.

Code: Select all

<FORM>
<TABLE>
</TABLE>
</FORM>
2.

Code: Select all

<TABLE>
<FORM>
</FORM>
</TABLE>
1 seems to actual method (accepted) but its entering a line break so the table height becomes a bit more (I cant assign actual value)
2 on the other hand gives the size of the table - the same size when no form tags are included.
So how am I suppossed to get rid of that line break ?

Posted: Mon Sep 06, 2004 3:08 pm
by feyd
CSS ::

margin:0;padding:0;

Posted: Mon Sep 06, 2004 8:50 pm
by anjanesh
<FORM ID="id1" METHOD=POST ACTION="" STYLE="DISPLAY:inline">

Posted: Mon Sep 06, 2004 10:59 pm
by anjanesh
Where can I find a JS Validator like the one in W3C's HTML Validator ?

Posted: Mon Sep 06, 2004 11:15 pm
by feyd
something wrong with your googling?
[google]javascript +validator[/google]

Posted: Tue Sep 07, 2004 1:03 am
by anjanesh
Nothing like entering a url and validate like W3C's HTML and CSS Validator.
Google Results in mostly (html validator still give errors because of javascript code) or some javasript validator library in js file.
The only other one I've seen is struts.

Posted: Tue Sep 07, 2004 9:08 am
by Draco_03
ps : i would suggest you using mozilla and go download the devlopper tool, I mean, it's tha BOMB ..
beileive me..

EWhat you doing still reading GO download it ... 8)

Posted: Tue Sep 07, 2004 10:15 am
by vigge89
some tips:

all tags and attribute-names should be lowercase
take away as much design attributes as you can, put it in an css file and include it
visit http://www.w3schools.com for CSS and HTML tips and examples