Jump to content

Doctype vs <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>


htmlnewbie23
 Share

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...