ifti
ifti

Reputation: 669

Render a Div in specific version of IE

I have an application which I am intentionally rendering in IE7 but want a div render in IE9 version if the browser is IE8+.

Is there any way to do it?

Reason to render application in IE 7 is because my client is using XP as well.

Please help ..

Upvotes: 0

Views: 71

Answers (2)

jilykate
jilykate

Reputation: 6018

You can use "CSS HACK" to distinguish different versions of IE. There are some ways to do it. 1. conditional comment

<!--[if gte IE 8]>this only works in IE8+<![endif]-->

2.prefix

.hack{background:#000\0;}/*works only in IE8+*/

3.@media

@media screen\0 {body { background: green; }}/*works in IE8+*/

for more details, you can look up in : http://mynthon.net/howto/-/webdev/CSS-big-list-of-css-hacks.txt

Upvotes: 1

securecodeninja
securecodeninja

Reputation: 2515

You can use IE's conditional comments:

https://msdn.microsoft.com/en-us/library/ms537512(v=vs.85).aspx

http://en.wikipedia.org/wiki/Conditional_comment

In your case:

<!--[if gte IE 8]>
<div>Your div</div>
<![endif]-->

Upvotes: 1

Related Questions