![]() |
|
|
|
#1 |
|
Is there a possible CSS or hack than can hide items if the browser
being used is IE. I am currently using wordpress and was using a plugin that results a horrendous output in IE but works perfectly in some other browsers. I will appreciate if someone can teach me how to make certain part of my website totally invisble or non existent if viewed in IE, but will work normally with other browsers. Thank you very much. I am willing to donate some $ for solution. 17th.of.april@gmail.com |
|
|
|
|
#2 |
|
Posts: n/a
|
wrote: > Is there a possible CSS or hack than can hide items if the browser > being used is IE. Conditional comments are the simplest and most reliable way. http://www.quirksmode.org/css/condcom.html http://msdn.microsoft.com/library/de...omment_ovw.asp > Thank you very much. I am willing to donate some $ for solution. I'd apreciate a donation to https://donate.cancerresearchuk.org/donatenow/ (or another cancer charity) |
|
|
|
#3 |
|
Posts: n/a
|
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. |
|
|
|
#4 |
|
Posts: n/a
|
OR
you could put the html you wish to hide on IE in a div then use css to hide it e.g. in the html <div id="iehide"> .....html to hide in ie </div> then in your css * html #iehide{display:none} Andy Dingley wrote: > 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. |
|
|
|
#5 |
|
Posts: n/a
|
Sym wrote:
> you could put the html you wish to hide on IE in a div then use css to > hide it How would that work ? You still need to switch display on and off on an IE-specific basis. |
|
|
|
#6 |
|
Posts: n/a
|
This is the "star html hack".
* html before the selector in a css is only interpreted by ie, other browsers ignore the selector. give it a go and see .... Andy Dingley wrote: > Sym wrote: > > > you could put the html you wish to hide on IE in a div then use css to > > hide it > > How would that work ? You still need to switch display on and off on > an IE-specific basis. |
|
|
|
#7 |
|
Posts: n/a
|
Sym wrote:
Please don't top post. > This is the "star html hack". > * html before the selector in a css is only interpreted by ie, other > browsers ignore the selector. Pretty sure that IE 7 ignores it too. So it wouldn't do what the OP asked. -- David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/> Home is where the ~/.bashrc is |
|