Search code examples
htmlhtml4

Why is <META HTTP-EQUIV="Content-Script-Type" ...> mostly unused?


Related: What's the point of Content-Script-Type and Content-Style-Type.

I wanted to know what the main reasons are that developers don't use

  • <meta http-equiv="content-script-type" content="text/javascript" /> and
  • <meta http-equiv="content-style-type" content="text/css" />

in their web projects. (Me neither, btw.)

Saving one from having to declare the used type on every instance of <script> and <style>, it does not seem to have any drawbacks. Yet, in fact, I have never seen one of them in the wild. Are there any considerations one has to take when relying on these <meta> tags?


Solution

  • According to W3C, http-equiv values "content-style-type" & "content-script-type" attributes are unknown for HTML5 meta markup! Moreover, W3C validator throws the following error when an HTML5 page has such markups:

    Line X, Column Y: Bad value Content-Script-Type for attribute http-equiv on element meta.

    <meta http-equiv="Content-Script-Type" content="text/javascript">

    So essentially we are supposed to avoid them.