htmlnewbie23 Posted November 12, 2015 Share Posted November 12, 2015 Sorry for the very basic question. I have a test page that does not have a doctype tag but instead has <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>. I attached the file. The W3 validator does not like it because of the absence of a doctype tag. Can't <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'> replace the doctype? Why not? If not, I do not know what doctype to put there because the code was automatically generated by the widely popular page: http://stevemorse.org/create/create.htmltest.html Link to comment Share on other sites More sharing options...
dsonesuk Posted November 12, 2015 Share Posted November 12, 2015 doctype determines how you page is rendered and what rules to follow, charset is character encoding for specific language content including special characters used for that specific language. 1 Link to comment Share on other sites More sharing options...
htmlnewbie23 Posted November 12, 2015 Author Share Posted November 12, 2015 Thanks. How do I determine the correct doctype to enter for this file since I did not code it and it did not come with a doctype? (Doesn't content='text/html serve as a doctype replacement?) Link to comment Share on other sites More sharing options...
davej Posted November 12, 2015 Share Posted November 12, 2015 Try this doctype... <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 1 Link to comment Share on other sites More sharing options...
COBOLdinosaur Posted November 17, 2015 Share Posted November 17, 2015 If you post some of the code we might be able to determine what standard it is coded to; though the fact that it has no doctype probably means the quality of the rest of the code is such that it could be anything. The doctype that davej posted is about as loose as you can get and with work with old sloppy code, but if there are any modern HTML5 tags it will have a problem with them. Without a doctype you have probably been rendering in quirks mode so you may find presentation changes as you find the right doctype. The page for the site where you got the code throws 349 errors in the validator when validated as html 4 transitional. the layout and methods in the source are straight out of the 20th century. In the future you probably don't want to consider that site a source of code. As for "widely popular" I don't know how you come to that conclusion; but in any case popularity and quality do not necessarily have a logical or rational relationship and I am not sure you can consider any site as widely popular when they have an Alexa ranking of over 100,000. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now