Go Back   Velocity Reviews > Newsgroups > HTML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

HTML - CSS for FIREFOX and OTHERS

 
Thread Tools Search this Thread
Old 08-10-2006, 10:48 AM   #1
Default CSS for FIREFOX and OTHERS


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
  Reply With Quote
Old 08-10-2006, 11:26 AM   #2
David Dorward
 
Posts: n/a
Default Re: CSS for FIREFOX and OTHERS


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)

  Reply With Quote
Old 08-10-2006, 11:31 AM   #3
Andy Dingley
 
Posts: n/a
Default Re: CSS for FIREFOX and OTHERS


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.

  Reply With Quote
Old 08-10-2006, 01:16 PM   #4
Sym
 
Posts: n/a
Default Re: CSS for FIREFOX and OTHERS

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.


  Reply With Quote
Old 08-10-2006, 02:17 PM   #5
Andy Dingley
 
Posts: n/a
Default Re: CSS for FIREFOX and OTHERS

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.

  Reply With Quote
Old 08-10-2006, 08:29 PM   #6
Sym
 
Posts: n/a
Default Re: CSS for FIREFOX and OTHERS

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.


  Reply With Quote
Old 08-10-2006, 11:31 PM   #7
David Dorward
 
Posts: n/a
Default Re: CSS for FIREFOX and OTHERS

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
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump