PDA

View Full Version : No DOCTYPE Declaration Found!


rph105
10-15-2007, 09:41 PM
when i check my site on w3.org it says "No DOCTYPE Declaration Found!", the start of my site starts like this <!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Real Proper Layouts BETA v.2 - The Place For The Rest Of Those Layouts...</title>
<head>


<link href="styles/style.css" rel="stylesheet" type="text/css" />
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


and its saying it should start like this

<!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" lang="en" xml:lang="en">
<head>

<title>Title</title>
</head>

<body>
<!-- ... body of document ... -->
</body>

</html>

can anyone help me in what i need to change to make it a valid html document.

Much Thanks

Raph

Jittor
10-15-2007, 10:00 PM
Did you set the validation at "Strict" if so strick is damn near impossible to pass, set it as what your page says "Transitional"

If this is an option at W3, I don't remember. What are you validation for, XHTML, XML?

rph105
10-15-2007, 10:05 PM
Did you set the validation at "Strict" if so strick is damn near impossible to pass, set it as what your page says "Transitional"

If this is an option at W3, I don't remember. What are you validation for, XHTML, XML?

nah i didnt set it at strict, i wanna validate it for xhtml i think, i'm gettin 11 errors on the W3 site. this is the main message its given me, that i need to take care of...

No DOCTYPE found! Attempting validation with HTML 4.01 Transitional.

The DOCTYPE Declaration was not recognized or is missing. This probably means that the Formal Public Identifier contains a spelling error, or that the Declaration is not using correct syntax. Validation has been performed using a default "fallback" Document Type Definition that closely resembles "HTML 4.01 Transitional", but the document will not be Valid until you have corrected this problem with the DOCTYPE Declaration.

Learn how to add a doctype to your document from our FAQ.

Ricky55
10-16-2007, 11:31 AM
Jittor is right loads of my pages have minor errors listed but if the pages view correctly in all major browsers I don't get too worried about it.

You could spend your entire life trying to get perfect valid documents.

Ricky55

Jittor
10-16-2007, 02:07 PM
The only difference I see is your charset,

charset=UTF-8" />

Other than that i don't know what to tell you. Just in case here is the link to the validator:

http://validator.w3.org/

domedia
10-16-2007, 02:41 PM
My dayjob basically consists of making validated 4.01 strict websites :) If anything it makes you a better coder.

Jittor
10-16-2007, 05:16 PM
validating for a 4.01 strict website is tough! I agree it would make you a much better coder.