Forum Moderators: open

Message Too Old, No Replies

Validation Problem

Xml- Html20?

         

Googly

1:44 pm on Mar 4, 2003 (gmt 0)



The following has been shown to be invalid on my html page.

<!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=iso-8859-1" />

With the validation error:
The tag: "meta" has an XML style closing syntax for an empty element even though version: "HTML20" is not an XML tag language.

Can anyone advise on what the correct meta should be please.

Googly

korkus2000

1:47 pm on Mar 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried it like this?

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

It may only take the closing tag for XHTML.

Googly

1:52 pm on Mar 4, 2003 (gmt 0)



That's the trick! Thanks very much for your quick answer korkus2000, much appreciated.

Googly

g1smd

12:39 am on Mar 6, 2003 (gmt 0)

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



One of the reasons that this is an error, is that the first / after <head> is interpreted as being </head><body> which then leads to cascading errors for all of the meta tags and for the real </head> and <body> tags.

Further information:

I usually put a minimum of this on every page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title> Your Title Here </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="EN-GB">
<meta name="Description" content=" Your Description Here. ">
<meta name="Keywords" content=" your, keyword, list, here ">
<meta name="MSSmartTagsPreventParsing" content="TRUE">
</head>

<body>

You can, and should, also optimise the title and description (and keywords) for each page individually to attract search engines.

Any <style> or <script> information within the <head> section, should always be after all of the meta tags.

External files should be used for <style> and <script> information where possible. These are called by:

<link type="text/css" rel="stylesheet" name="commonstyle" src="/path/file.css">

<script type="text/javascript" language="javascript" src="/path/file.js"></script>

All <style> information must be with the <head> section.

However, a <script> can be either within the <head> or <body> section.