Coolguy
Coolguy

Reputation: 2285

Can we put two meta tags in HTML?

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.

Upvotes: 20

Views: 22110

Answers (2)

andy magoon
andy magoon

Reputation: 2929

Yes, you may include many, and do not try to combine them.

Upvotes: 3

Golo Roden
Golo Roden

Reputation: 150644

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.

Upvotes: 16

Related Questions