Hide DIV only in IE8

Asked

Viewed 97 times

0

I have a small doubt, how do I hide a div (.laser) only in IE8?

Preferably would like to use only CSS or also JS

1 answer

2


Create a file .css called, for example, ie.css. Make your call in the header of your page/site/application as follows:

<!--[if lte IE 8]>
    <link rel="stylesheet" type="text/css" href="ie.css" />
<![endif]-->

Inside it, just hide the div as you normally would:

.laser{
    display: none;
}

All rules within this file will apply only to IE 8 or earlier versions.

If you want to reach other versions of IE or a range of them, this is an excellent reference.

  • This example works for all of the above 8. If they were all Ies, the condition would be <!--[if IE]>

  • 1

    You’re right, sorry for the lack of attention, I’ve removed the comment

  • @Caiofelipepereira thank you very much!! it worked here. Maybe you take me another doubt, how would you run the radios in IE8 - sorry that other question more you seem to master cross browser, rs!! v

  • @Davivoltas, if you have another question, ask a new one. This way, the information is better distributed, making it easier for others who may have the same doubts as you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.