...

View Full Version : validating problems



jomothepure
11-25-2008, 11:29 PM
Hi,

I'm really sorry to burst in like this. Have just come across the forum in a search, and will give it some in depth browsing tomorrow!

I was wondering if any kind souls could take pity on me and help out with a couple of snags I'm hitting with validating the html of a web page? I'm afraid I'm a total novice, not to mention clutz, and so am completely useless at adressing the problems the validator chucks at me, so any advice gratefully received!


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>Test</TITLE>
<body bgcolor=white text=black link=black alink=black vlink=black>
</HEAD>


<font face="verdana">
<center>
<table width=800 cellpadding=0 cellspacing=0 border=0>

<tr><td colspan=7 height=100 valign=bottom align=left><font size=6>test.com</font></td></tr>
<tr>

<td width=199 bgcolor=gray align=center><a style="text-decoration:none" href="link.html"><font size=3 color=white>link</font></a></td><td width=2></td>
<td width=198 bgcolor=black align=center><a style="text-decoration:none" href="link.html"><font size=3 color=white>link</font></a></td><td width=2></td>
<td width=198 bgcolor=black align=center><a style="text-decoration:none" href="link.html"><font size=3 color=white>link</font></a></td><td width=2></td>
<td width=199 bgcolor=black align=center><a style="text-decoration:none" href="link.html"><font size=3 color=white>link</font></a></td></tr>

<tr><td colspan=7 height=2></td></tr>

<tr>

<td width=199 bgcolor=black align=center><a style="text-decoration:none" href="link.html"><font size=3 color=white>link</font></a></td><td width=2></td>
<td width=198 bgcolor=black align=center><a style="text-decoration:none" href="link.html"><font size=3 color=white>link</font></a></td><td width=2></td>
<td width=198 bgcolor=black align=center><a style="text-decoration:none" href="link.html"><font size=3 color=white>link</font></a></td><td width=2></td>
<td width=199 bgcolor=black align=center><a style="text-decoration:none" href="link.html"><font size=3 color=white>link</font></a></td></tr></table>

<table width=800 cellpadding=0 cellspacing=0 border=0>
<tr><td colspan=3 height=12></td></tr>
<tr><td width=199 height=400 valign=top align=left>

some
links<br>
will<br>
go<br>
here<br>
when<br>
they need<br>
to be<br>
added<br>



</td><td width=2 height=400></td><td width=599 height=400 valign=top align=left>

Welcome to my website. I am having problems because I am an idiot and can't work out what's stopping my code being validated! If anyone can help me I'd be very grateful!

</td></tr>

<tr><td colspan=3 height=50 align=center valign=top><hr><font size=1><a style="text-decoration:none" href="link.html">SOME</a> | <a style="text-decoration:none" href="link.html">MORE</a> | <a style="text-decoration:none" href="link.html">LINKS</a> | <a style="text-decoration:none" href="link.html">HERE</a></font></td></tr></table>


</table>

</center>
</font>
</body>
</HTML>


When I run this through the W3 validator, I get these 3 errors:

Line 6, Column 6: end tag for element "HEAD" which is not open
Line 10, Column 7: document type does not allow element "CENTER" here; missing one of "APPLET", "OBJECT", "MAP", "IFRAME", "BUTTON" start-tag.
Line 55, Column 7: end tag for element "TABLE" which is not open.

I think I know the answer to Line 10 - you're not strictly allowed to simply stick a table in between <center> tags.

But what problem it has with the <head> and the <table> I'm not sure. As you'll see, I've got a title in the <head> and that sort of thing, so bit stumped :confused:

I'm really sorry, as I appreciate you must be sick of folk signing up to the forum and coming to sponge of your masterful knowledge, but if someone could give me a nudge on this, I'd be eternally grateful. I can then take a deep breath and hang about a bit longer.

Thanks!

queirdo
11-25-2008, 11:52 PM
The head problem is simple. Your head needs to come before your body like this:


<head>
</head>
<body>
</body>

You've accidentally put your starting tag for your body inside the head tags.

Your table problem is also a tag nesting issue. If you take out everything in between all your table tags, you get this:


<table width=800 cellpadding=0 cellspacing=0 border=0>
</table>

<table width=800 cellpadding=0 cellspacing=0 border=0>
</table>

</table>



That's one too many closing tags. Delete the last one in your code.

jomothepure
11-26-2008, 11:26 AM
Sir, you are a genius!

Seriously, thanks for that. Totally forgot the body tag comes after the head tag :eek: (That's how bad I am)

And the 'ol duplicate table tag - I'd have searched through the code for hours and never have found it. Sometimes it's better having a second pair of eyes. Many thanks again.

With those out of the way, the W3 threw up some more stuff - the font tags etc. In changing these values to an acceptable code for validation (ie using css) I've actually managed to give myself a bit more of a rudimentary grasp of css, which before was non-existent (not good).

I even picked up how to center a table using css, so it's all good! (I think)

So just in case anyone's interested (run away now :D) here's the final version.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<TITLE>Test</TITLE>

<style type="text/css">
table
{
margin-left: auto;
margin-right: auto;
}
.verdana {
font-family: Verdana, Arial, Georgia
}
.colorchange {
color: white
}
.bigverdana {
font-size: 10mm; font-family: Verdana, Arial, Georgia
}
.smallverdana {
font-size: 3mm; font-family: Verdana, Arial, Georgia
}
</style>

</HEAD>
<body bgcolor=white text=black link=black alink=black vlink=black>


<table width=800 cellpadding=0 cellspacing=0 border=0>

<tr><td colspan=7 height=100 valign=bottom align=left class="bigverdana">test.com</td></tr>
<tr>

<td width=199 bgcolor=gray align=center class="verdana"><a style="text-decoration:none" href="link.html" class="colorchange">link</a></td><td width=2></td>
<td width=198 bgcolor=black align=center class="verdana"><a style="text-decoration:none" href="link.html" class="colorchange">link</a></td><td width=2></td>
<td width=198 bgcolor=black align=center class="verdana"><a style="text-decoration:none" href="link.html" class="colorchange">link</a></td><td width=2></td>
<td width=199 bgcolor=black align=center class="verdana"><a style="text-decoration:none" href="link.html" class="colorchange">link</a></td></tr>

<tr><td colspan=7 height=2></td></tr>

<tr>

<td width=199 bgcolor=black align=center class="verdana"><a style="text-decoration:none" href="link.html" class="colorchange">link</a></td><td width=2></td>
<td width=198 bgcolor=black align=center class="verdana"><a style="text-decoration:none" href="link.html" class="colorchange">link</a></td><td width=2></td>
<td width=198 bgcolor=black align=center class="verdana"><a style="text-decoration:none" href="link.html" class="colorchange">link</a></td><td width=2></td>
<td width=199 bgcolor=black align=center class="verdana"><a style="text-decoration:none" href="link.html" class="colorchange">link</a></td></tr></table>

<table width=800 cellpadding=0 cellspacing=0 border=0>
<tr><td colspan=3 height=12></td></tr>
<tr><td width=199 height=400 valign=top align=left class="verdana">

some
links<br>
will<br>
go<br>
here<br>
when<br>
they need<br>
to be<br>
added<br>



</td><td width=2 height=400></td><td width=599 height=400 valign=top align=left class="verdana">

Welcome to my website. I am having problems because I am an idiot and can't work out what's stopping my code being validated! If anyone can help me I'd be very grateful!

</td></tr>

<tr><td colspan=3 height=50 align=center valign=top class="smallverdana"><hr><a style="text-decoration:none" href="link.html">SOME</a> | <a style="text-decoration:none" href="link.html">MORE</a> | <a style="text-decoration:none" href="link.html">LINKS</a> | <a style="text-decoration:none" href="link.html">HERE</a></td></tr></table>

</body>
</HTML>

abduraooft
11-26-2008, 11:38 AM
So just in case anyone's interested (run away now ) here's the final version. Here is an interesting link www.hotdesign.com/seybold/ which would worth for you.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum