I was just looking at the meta tag in the <head> on Stack Overflow site and I do not see any reference to the Content-Type used?

Is there any difference between setting the http header information through the meta tag or directly setting it on the response? Any issues related to browser compatibility?

  • 1
    reason for down vote?
    – user134608
    Commented Sep 20, 2009 at 15:41
  • 1
    Looks like the downvote was for your flippant attitude in the first version. Good to see techzen's compliance with asking nicely.
    – random
    Commented Sep 20, 2009 at 15:42

2 Answers 2


Why simulate HTTP headers with http-equiv when you can use HTTP headers directly?

  • Any possibility with of lack of compliance with older browsers?
    – user134608
    Commented Sep 20, 2009 at 15:47
  • 3
    I was always under the impression that the http-equiv thing was a hack added to HTML to give you the ability to set this value even if you don't have the ability to modify the HTTP headers. Browsers are more likely to respect an HTTP header rather than an HTML hack to emulate that HTTP header. Not to mention that both have been around long enough that any browser newer than IE 4 probably supports both. Commented Sep 20, 2009 at 20:17
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >

The W3C's Internationalization and Localisation (L18n) Body recommends setting the header with an apache .htaccess file. It's always the case the the header will supersedes any information found within the content, http-equiv is meant to be used as a fall back last resort. This is how it has been implemented. However as I understand it, it would seem that http-equiv was meant to be used as the last word on how the content was to be displayed to the user.

W3C's L18n does have a recommendation on what type of tag to use and when.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .