Jump to content

Code validator


russ208

Recommended Posts

Hi,

I copied the HTML 4.01 Strict doctype from here http://www.w3.org/QA/2002/04/valid-dtd-list.html and I did a code validation and got this error :Line 82, Column 3: "DOCTYPE" declaration not allowed in instance<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/s…

Please help!! I have no idea what to do to fix this issue as I am a beginner

Many thanks

ps my site is www.literalconcepts.com

Link to comment
Share on other sites

Thanks Symphlion. Line 82. How do I fix this? I haven't a clue?? I found this while searching for a html 4.01 strict doctype: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

In fact I found a lot of different versions. Why are there so many? Sorry I have no clue when it comes to code. Will this doctype work? When I did a code validation in had warnings. I really appreciate the help!!

Link to comment
Share on other sites

I just did another search on doctypes and found

DOCTYPE declarations are technically optional, and not using one does not cause an error; for example, you can create a Web page without a DOCTYPE declaration, and Microsoft® Internet Explorer, Netscape Navigator, Mozilla, and Opera may all render the page as you intended. However, as your Web pages become more complex, lack of a DOCTYPE declaration can cause pages to render differently than expected or desired. (This is sometimes referred to as "quirks mode.")

 

So if my webpage appears fine on most browsers, I should forget the doctype??

Link to comment
Share on other sites

No. I'm assuming you're quoting from http://msdn.microsoft.com/en-us/library/Aa218654 ? That's old information, and note that it's in the help for FrontPage 2003, which was released 9 years ago and FrontPage is almost universally looked down upon by web developers due to the terrible code it created.

 

Doctypes are important, since they tell the browser how to render the page. Internet Explorer especially has issues with a lack of a doctype, and missing a doctype usually causes cross-browser compatibility issues where different browsers display the site differently.

Link to comment
Share on other sites

My next question is, do I only copy this code into the 1st page of my site or all 5 pages? Same question applies to the keywords

 

Absolutely YES - the doctype belongs to the top of every page.

 

These days, the keywords in the head section of a document don't have the same search engine importance as they did years ago, but if you want to add the, add them - and they can be customized for the content of the individual pages.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...