PDA

View Full Version : HTML validation help



wen_laat
01-31-2005, 05:08 PM
I don't know if this is the correct forum for this question, but I didn't know where else to put it.

I've been working on my html validation, because I never really paid attention to it, until I started to use Firefox and Safari, and I really want to have a validated html code.

Well, I went from over 70-80(!) errors to 2. I'm kinda happy with that, but 2 is still too much. I've tried everything to correct these 2 errors, but nothing works, so I'm hoping someone here can help me.

Here's the link with the errors and my url:
Validation Page (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.typicaldutchstuff.com%2 Fnewindex.shtml&charset=%28detect+automatically%29&doctype=%28detect+automatically%29)

paulhiles
01-31-2005, 06:46 PM
First error is easiest to fix...
you have two body tags! :o)


21: <body>
22: <body bgcolor="#F9E5F1">

rivux
01-31-2005, 06:48 PM
You have two body tags, you need to remove one of them.



<body>
<body bgcolor="#F9E5F1">

rivux
01-31-2005, 06:48 PM
haha sorry paul, was posted the same time as you.

paulhiles
01-31-2005, 06:50 PM
LOL!! Think we collided mid-air! I felt some sort of collision anyway! :o)

paulhiles
01-31-2005, 06:55 PM
Error number two...
Line 26: Try this.....

<td colspan="2" bgcolor="#F5AFD5" height="90" width="750">Websitepics/bannner.png</td></tr>

An alternate solution might be to use CSS to load the background image, and might save you a few bytes. Are you using the same image for each page header?

Paul

wen_laat
02-01-2005, 05:03 AM
thanks so much you guys, my page is now valid! How would I use CSS to load the background image? I'm using the same one for every page.

Another thing, before the page was validated (and had loads of errors), the page looked perfect in IE; the text was aligned to the left. In Firefox it was a bit different; it was centralized. Now with the valid html it looks perfect in Firefox and in IE it looks like it was before with Firefox. (hope this makes sense) How is this possible?

Sanjo
02-01-2005, 01:41 PM
Looks like you've gotten everything taken care of.

You are quick!

wen_laat
02-02-2005, 05:48 PM
Thanks you guys!

you know what's strange; in IE my pages look crappy when validated and they look perfect in Firefox/Safari, whilst this first was the other way around. Does IE just not accept the html?

paulhiles
02-02-2005, 06:37 PM
Hi wen_laat,

try using the following as your style.css

/* Stylesheet for TypicalDutchStuff */
a:link {
color:#333333;
text-decoration:none;
}
a:visited {
color:#333333;
text-decoration:none;
}
a:active {
color:#333333;
text-decoration:none;
}
a:hover {
color:#FF4040;
text-decoration:none;
}

body, tr, p, td {
font-size:8pt;
font-family:verdana;
color:#000000;
}

.heading {
text-align:center;
font-size:9pt;
font-family:verdana;
font-weight:bold;
color:#000000;
}

I noticed you have some code comments and <style> tags that are causing some discrepancies between the Firefox view and IE. Check and debug any differences after you've uploaded this modified stylesheet.

Paul

wen_laat
02-03-2005, 01:14 PM
paulhiles:

Thank you. I've changed the stylesheet, and tried to validate another page, which isn't working. I've used the same things as my index page which is verified, but some things don't seem to be correct now, while they are on the other page.

Not validated yet (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.typicaldutchstuff.com%2 Ffeedback1.shtml)

Also, I've found that as soon as I use
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
then the text aligns strangely in IE, but allright in other browers.

What am I doing wrong? I've been trying different things all day, but seem to be stuck. :(

paulhiles
02-03-2005, 02:05 PM
I've used the same things as my index page which is verified, but some things don't seem to be correct now, while they are on the other page.
Not validated yet (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.typicaldutchstuff.com%2 Ffeedback1.shtml)
On the feedback page you need to close the <head> of your document. Looks as though you have an include file / SSI in the wrong spot! There is HTML code for a table running straight after the closing script tag. The closing </head> and <body> tags are way down at line 267, 268! :o)

Paul

wen_laat
02-03-2005, 04:27 PM
I've used the same things as my index page which is verified, but some things don't seem to be correct now, while they are on the other page.
Not validated yet (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.typicaldutchstuff.com%2 Ffeedback1.shtml)
On the feedback page you need to close the <head> of your document. Looks as though you have an include file / SSI in the wrong spot! There is HTML code for a table running straight after the closing script tag. The closing </head> and <body> tags are way down at line 267, 268! :o)

Paul

Ok, you have no idea how silly I just felt. The include file was inside the head tag, how could I overlook that?! *blushes* It's now validated, but when I use this code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
It messes up the layout, so I'm just using

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
and it works perfectly in IE and Firefox!

I'm so thrilled, I'm going to change all the pages and then my site will be entirely validated! Who needs Oscommerce when you can do it all by hand ;)

Thanks again Paul, you've helped me a lot!

paulhiles
02-03-2005, 06:38 PM
Great to hear you've managed to get that sorted!
I think we have the makings of another hand-coder here! :o)

Paul

wen_laat
02-03-2005, 06:55 PM
Great to hear you've managed to get that sorted!
I think we have the makings of another hand-coder here! :o)

Paul

Thanks! I did encounter another problem though, was almost afraid to ask, as I've asked so much already ;)

EDITED: I'm working on my other pages, but it seems as though the EUR symbol(€) gives an error, is there any way around this?
Just fixed this myself!

Also, I use Mals shopping cart, and the code seems to contain an error, but when I change it, the cart probably won't work properly.

One error left.. (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.typicaldutchstuff.com%2 Fgiftwrap.shtml)

Thanks! (If I can figure out this thing, I can probably manage to do all my pages..

paulhiles
02-04-2005, 04:37 AM
You have three forms in the left-hand column and two in the main page content. The form that's causing the problem is the "newsletter" one. There are some invalid tags in there, table cells, font tags, etc!

Try using this instead...

<table bgcolor="#FBEBF3" border="0" cellpadding="3" cellspacing="0">
<tr><td align="center"><font size=1 face="Verdana,Arial,Helvetica">Join the Typical Dutch Stuff mailing list </font></td></tr>
<tr><td align="center"><font size=1 face="Verdana,Arial,Helvetica">Email:</font>
<form name="newsletter" action="http://www.typicaldutchstuff.com/newsletter.html" target="_blank" method="get">
<input type=text name="email" size=15>
<input type=submit name="go" value="Sign up">
</form></td></tr>
</table>

The form's attributes/values need quotes("") around the values too! That's about it, I think! :o)

One other point, you're displaying linked images from two other sites (the W3C logo and GeeksOnSteroids banner). I would advise you to have these images on your own server, as they're currently slowing down the page loading.

Paul

PS. Try taking some of your font tags out and replacing with CSS styled elements!

wen_laat
02-04-2005, 07:18 AM
thank you! It's been fixed, you've helped me so much!

I don't really work with CSS, so have no idea how to change the fonts?

paulhiles
02-04-2005, 07:28 AM
thank you! It's been fixed, you've helped me so much!
You're welcome! Glad to have helped!


I don't really work with CSS, so have no idea how to change the fonts?
You could reduce your page sizes marginally by utilising more CSS, but you're not using so many font tags, I guess I'll let you off!
Any questions you might have on CSS, just try the Site Design (http://www.webproworld.com/viewforum.php?f=11) forum and ask around, there are lots of knowledgeable members there! :o)

Paul