Posted by Andy Dingley on 08/10/06 10:31
17th.of.april@gmail.com wrote:
> Is there a possible CSS or hack than can hide items if the browser
> being used is IE.
Yes. Quite simply too.
IE has a feature called "conditional comments". These are pairs of
genuine HTML comments, which can have HTML between them. This is
absolutely valid HTML and any real browser will see them as two
comments with renderable content between them.
However if you select the right conditional test, IE (or even specific
IE versions) will instead treat both comments as being the start and
end of one jumbo comment, hiding all the content between them.
<!--[if !IE]>--><img src="..." alt="Won't appear in IE"
><!--<![endif]-->
Note that this is only safe if you use the !IE form and test for _not_
IE. Otherwise real browsers treat this feature as invalid and render
the middle section anyway.
Navigation:
[Reply to this message]
|