Forum Moderators: open

Message Too Old, No Replies

Validation error - "encoding problem"

         

Tomness

11:29 am on Jul 1, 2005 (gmt 0)

10+ Year Member



I've just for the first time, attempted to make my website valid, and it's more or less worked according to the validator. However there is one line that is bugging me.

Here is what the validator said.


1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2:
3: <html>
4: <head>
5: <title>####</title>
6:
7: <meta name="author" content="#" />
8: <meta name="keywords" content="####"/>
9: <meta name="description" content="####" />
10:
11: <link rel="stylesheet" type="text/css" href="stylesheet.css" />
12: <link rel="shortcut icon" href="http://www.####/favicon.ico">
13:
14: </head>
15:
16: <body class=gbody>
17:
18: <div id="container">
19:
20: <div id="banner" background="banner.gif">
21: </div>
22:
23: <div id="navigation">
24: ¦ Home ¦ Mr Tom ¦ Site Related ¦ Reviews ¦ Animations ¦ Forums ¦ Games ¦ Links ¦</div>
25:
26: <div id="spacer">
27: </div>
28:
29: <div id="content">
30: <b>####:</b><p>
31:
32: ####
33: </div>
34:
35: <div id="spacer">
36: </div>
37:
38: <div id="navigation">
39: #### encoding problem on this line, not shown ####
40: </div>
41:
42: </div>
43:
44:
45: </body>
46:
47:

What does that mean? Where it has said #### encoding problem on this line, not shown #### I have used a similar concept as my navigation.

Navigation:

¦ Home ¦ Mr Tom ¦ Site Related ¦ Reviews ¦ Animations ¦ Forums ¦ Games ¦ Links ¦

Footer:

¦ Back ¦ © 2004 - 2005 ¦ Version # ¦ # Online ¦ Email Me ¦ Top Of Page ¦

However, the footer does not show, and there is a problem. Why?

Here is the HTML for the footer.


<div id="spacer">
</div>

<div id="navigation">
¦ Back ¦ © 2004 - 2005 ¦ Version 7 ¦ 3 Online ¦ Email Me ¦ Top Of Page ¦
</div>

</div>

mattur

12:31 pm on Jul 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's an encoding problem ;) You are using "special characters" like the copyright symbol and the broken pipe symbol but not specifying a charset for those symbols. You should add a content type tag in the header like:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

For more info on this, and using character references, see:
[w3.org...]

There are some other problems with your code: an id is a unique element - use a class for multiple elements; you're using xhtml syntax on your html page (no need for " />" on tags in html); there is no "background" attribute for the div tag; and you're not closing the <html> tag.

HTH

Tomness

12:44 pm on Jul 1, 2005 (gmt 0)

10+ Year Member



Thank you, I'll add that, and check out that url.

Those tips were really helpful, thanks.

I'll get back to you when I put them into play.

(I did close my HTML tags, I just cut it off by accident when I copied and pasted it, and never realized.)

ckarg

12:57 pm on Jul 1, 2005 (gmt 0)

10+ Year Member



The safest way to put a copyright char into an html doc is to use &copy;

g1smd

1:08 pm on Jul 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>> I did close my HTML tags, I just cut it off by accident when I copied and pasted it, and never realized. <<

That isn't the problem. This is:

<meta name="description" content="####" />

You must not include a / inside a <meta>, <link>, <img>, <hr>, <br>, and any other "single" tag if you are using HTML 4.01.

They are only needed if you are using XHTML code.

Tomness

2:50 pm on Jul 3, 2005 (gmt 0)

10+ Year Member



Thank you, you two.

I'll do that.

Tomness

4:49 pm on Jul 3, 2005 (gmt 0)

10+ Year Member



I have done it - my code is now valid. Thank you everyone for the help, it is greatly appretiated.