Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-25-2008, 10:29 PM   PM User | #1
jomothepure
New to the CF scene

 
Join Date: Nov 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
jomothepure is an unknown quantity at this point
validating problems

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

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!
jomothepure is offline   Reply With Quote
Old 11-25-2008, 10:52 PM   PM User | #2
queirdo
New Coder

 
Join Date: Nov 2008
Posts: 16
Thanks: 1
Thanked 1 Time in 1 Post
queirdo is an unknown quantity at this point
The head problem is simple. Your head needs to come before your body like this:
Code:
<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:
Code:
<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.
queirdo is offline   Reply With Quote
Old 11-26-2008, 10:26 AM   PM User | #3
jomothepure
New to the CF scene

 
Join Date: Nov 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
jomothepure is an unknown quantity at this point
Sir, you are a genius!

Seriously, thanks for that. Totally forgot the body tag comes after the head tag (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 ) 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>
jomothepure is offline   Reply With Quote
Old 11-26-2008, 10:38 AM   PM User | #4
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
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.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:32 PM.


Advertisement
Log in to turn off these ads.