CSS for FIREFOX and OTHERS

1

17th.of.april

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.
 
D

David Dorward

A

Andy Dingley

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.

<!--<![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.
 
S

Sym

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 said:
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.

<!--<![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.
 
A

Andy Dingley

Sym said:
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.
 
S

Sym

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 ....
 
D

David Dorward

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top