Home > DeveloperSection > Forums > Can we put two meta tags in HTML?
Babe Zaharias
Babe Zaharias

Total Post:19

Points:133
Posted on    July-19-2013 11:34 PM

 HTML5 HTML5 
Ratings:


 1 Reply(s)
 1076  View(s)
Rate this:

Can I put two meta tags in a web page?

I want to put:

 <meta http-equiv="Pragma" content="no-cache" />

so that my web page will not be cached

and:

 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

so that my web page is IE-compatible.



shreesh chandra shukla
shreesh chandra shukla

Total Post:105

Points:735
Posted on    July-19-2013 11:58 PM

Hello Mr. Babe!

Yes, this is definitely possible and valid (and actually most of the times even necessary). Basically, you can have an arbitrary number of them, as long as you put all of them into the head section of your website. Additionally you should watch out not to have multiple meta elements for the same concern.

Please note that for full XHTML compliance your second meta is missing the closing /. It should be:

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

So your final code might be:

<meta http-equiv="Pragma" content="no-cache" />

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

Please note as well, that the order of the meta elements is not completely arbitrary, or at least there are some elements where you should pay attention to the order.

E.g., the meta element that defines the encoding should be as far at the beginning as possible, since the browser will start re-rendering the website as soon as it approaches this element.


Don't want to miss updates? Please click the below button!

Follow MindStick