Is it bad to put <div> elements within the <head> tags?

Gaelen picture Gaelen · Feb 2, 2012 · Viewed 8.5k times · Source

I want to use conditional comments to make a DIV appear ONLY in browsers with IE7 or older, like this:

<!--[if lt IE 7]>

<div id="browsernotice">
<p>You are using IE7 or less</p>
</div>

<![endif]-->

As far as I understand, conditional comments only work in the header.

Is this bad?

Should I rather use conditional comments to instert a stylesheet that makes an invisible DIV visibility:visible?

Answer

josh3736 picture josh3736 · Feb 2, 2012