Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hiding some HTML from IE6?

I've tried:

<!--[if lt IE 6.0]>
HTML TO HIDE FROM IE6
<![endif]-->        

but unfortunately the stuff gets hidden from firefox too. Anyone have methods that work? I want the stuff to be hidden from only IE6

Thanks

like image 642
rawrrrrrrrr Avatar asked Jul 30 '09 04:07

rawrrrrrrrr


1 Answers

You can actually use conditional comments to hide things from Internet Explorer contrary to the answer from deceze. These types of conditional comments are called 'Downlevel Reveal Conditional Comments'. (These are different from comments used to show things to internet explorer which are more common, those are known as 'Downlevel hidden conditional comments')


<!--[if lte IE 6]><![if gte IE 7]><![endif]-->
<!-- This is a bit mad, but code inside here is served to everything 
    except browsers less than IE7, so all browsers will see this -->
<!--[if lte IE 6]><![endif]><![endif]-->

However if you already using a downlevel hidden conditional comment to show a IE6 stylesheet just to IE6 then you might be best off just hiding it with CSS.

I hope this helps.

like image 61
Natalie Downe Avatar answered Oct 05 '22 17:10

Natalie Downe