russ208 Posted February 2, 2012 Report Posted February 2, 2012 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 Quote
Symphlion Posted February 2, 2012 Report Posted February 2, 2012 You can remove line 82. The DOCTYPE should ( and is ) declared at the top of your page. You can remove the second DOCTYPE as it serves no purpose. Quote
russ208 Posted February 2, 2012 Author Report Posted February 2, 2012 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!! Quote
russ208 Posted February 2, 2012 Author Report Posted February 2, 2012 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?? Quote
falkencreative Posted February 2, 2012 Report Posted February 2, 2012 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. Quote
russ208 Posted February 2, 2012 Author Report Posted February 2, 2012 Thanks for your reply Ben I inserted <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> I tested it on 4 browsers. Seems to work fine. 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 Thanks again Quote
Andrea Posted February 2, 2012 Report Posted February 2, 2012 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. Quote
russ208 Posted February 2, 2012 Author Report Posted February 2, 2012 Thanks so much Andrea! Is my code ok?? Quote
Recommended Posts
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.