Click to See Complete Forum and Search --> : w3c html validation help


ukemike
10-21-2003, 07:34 AM
Im trying to validate my website, but when i type my link in the w3c validation form, i get an error msg:

"I was not able to extract a character encoding labeling from any of the valid sources for such information. Without encoding information it is impossible to validate the document. The sources I tried are:

The HTTP Content-Type field.
The XML Declaration.
The HTML "META" element. "

i know it has something to do wid my doctype declaration. here is what i have:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

anyone know what the problem is

thanx
mike

Robert Wellock
10-21-2003, 08:57 AM
Please give use the URL of your page probably you don't have a proper DTD and encoding for example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Plus you'll need within the <head> element:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >

Unless of course you are using XHTML, or another DTD or encoding.

ukemike
10-21-2003, 11:31 AM
ok so lets say i am coding xhtml what do i need in the top and in the <head> of all my documents??

thanx
mike

Robert Wellock
10-21-2003, 11:52 AM
You could follow the link to my website, though it depends on what DTD you want to use try:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

Jona
10-21-2003, 01:33 PM
Keep in mind that if PHP is installed on the server, your document has a .php extension, and if your server supports short-extensions in PHP (which most do), you can't use the following XHTML tag:


<?xml version="1.0" encoding="UTF-8"?>


If that is the case, I'd suggest using the following meta tag in its place:


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


Just thought I'd make mention of that, in case there was any question on it.

[J]ona

nkaisare
10-21-2003, 01:46 PM
Originally posted by Robert Wellock
You could follow the link to my website, though it depends on what DTD you want to use try:
<?xml version="1.0" encoding="UTF-8"?>

Robert, doesn't the xml declaration put IE and Opera6 in buggy mode? I personally do the following:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<meta http-equiv="content-type" content="text/html;
charset=iso-8859-1" />
...

ukemike
10-22-2003, 08:14 AM
ok look at this:

Im trying to validate:
http://www.dreambubble.net/about_me.html
for XHTML and in the w3c its saying that it cant validate this file.

any ideas why??
thanx
mike

spufi
10-22-2003, 10:17 AM
Originally posted by ukemike
ok look at this:

Im trying to validate:
http://www.dreambubble.net/about_me.html
for XHTML and in the w3c its saying that it cant validate this file.

any ideas why??
thanx
mike

Here's what your <head> tag shjould look like.

<head>
<title> About DreamBubble, Web design and development, asp.net</title>
<meta http-equiv="content-type" content="text/html" charset=iso-8859-1 />
<link href="scripts/style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="scripts/java.js"> </script>
<meta NAME="DreamBubble" CONTENT="" />
<meta NAME="Web design, web development, asp.net" CONTENT="" />
</head>

Opening <style> tag should be this

<style type="text/css">

<font> tags are deprecated, so they are not allowed to be used in a XHTML Strict file.

</ul align="left"> should be

<ul style="text-align:left;">

<img src="images/bottom.jpg" align="left"> should be

<div style="text-align:left;">
<img src="images/bottom.jpg" width="whatever the width is" height="whatever the height is" alt="text shown if image doesn't display" />
</div>
And any <br> tags should be <br />

You will also want to take a look at this page for the official word on XHTML

http://www.w3.org/TR/xhtml1/

spufi
10-22-2003, 10:20 AM
While I'm at it, since you already have a external CSS file set up, you might as well use it to define all of your CSS.

Robert Wellock
10-22-2003, 12:34 PM
Yes, M$ does go into extra buggy mode Niket though every IE before 6.0 does not use the Standards Engine either and remember we should be aim to serve XHTML as XML.

An XML declaration is not required in all XML documents; however XHTML document authors are strongly encouraged to use XML declarations in all their documents. Such a declaration is required when the character encoding of the document is other than the default UTF-8 or UTF-16 and no encoding was determined by a higher-level protocol.