By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,447 Members | 1,136 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,447 IT Pros & Developers. It's quick & easy.

IE 5.5, 6 only OR everything BUT those

P: n/a
I've got a form used to enter items to be listed in a web-based
catalog. In the past, I've instructed the users to enter I and B tags
(this goes back a while) into the textareas to get italics and bold
face in the catalog.

Now I've created a version of the page for IE that uses the
proprietary contentEditable="true" attribute on a div , which enables
the user to enter text into the div and use Ctrl-I and Ctrl-B to
produce italics and boldfacing. (It permits other formatting too, but
I'm only interested in these two effects.) I'm using display: none on
the textarea. The div has an onblur that transfers its current
contents to the textarea.

I would like to use this single page on all browsers. On IE, I'd like
the div to appear and the textarea to be hidden, and vice versa on
other browsers. Suppose I assign the textarea to a class called "ifIE"
and the div to a class called "ifNotIE". What kind of kludge will
result in

.ifIE { display: block; }
.ifNotIE {display: none; }

in IE and

.ifIE { display: none; }
.ifNotIE {display: block; }

elsewhere?

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 20 '05 #1
Share this Question
Share on Google+
15 Replies


P: n/a
Harlan Messinger wrote:
What kind of kludge will result in

.ifIE { display: block; }
.ifNotIE {display: none; }

in IE and

.ifIE { display: none; }
.ifNotIE {display: block; }

elsewhere?


I'm not commenting on whether the idea is sound. But to hide css from
IE, use the child selector.

..ifIE { display: block }
..ifNotIE { display: none }

body>div.ifIE { display: none }
body>div.ifNotIE { display: block}

--
Brian (follow directions in my address to email me)
http://www.tsmchughs.com/

Seen on the web:
This page best viewed by coming over to my office and looking at it on
my monitor.

Jul 20 '05 #2

P: n/a
Brian <us*****@julietremblay.com.invalid-remove-this-part> wrote:
Harlan Messinger wrote:
What kind of kludge will result in

.ifIE { display: block; }
.ifNotIE {display: none; }

in IE and

.ifIE { display: none; }
.ifNotIE {display: block; }

elsewhere?


I'm not commenting on whether the idea is sound. But to hide css from
IE, use the child selector.

.ifIE { display: block }
.ifNotIE { display: none }

body>div.ifIE { display: none }
body>div.ifNotIE { display: block}


Thanks. Only good till IE 7, though, right? :-)

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 20 '05 #3

P: n/a
Harlan Messinger <hm*******************@comcast.net> wrote:
Brian <us*****@julietremblay.com.invalid-remove-this-part> wrote:
Harlan Messinger wrote:
What kind of kludge will result in

.ifIE { display: block; }
.ifNotIE {display: none; }

in IE and

.ifIE { display: none; }
.ifNotIE {display: block; }

elsewhere?


I'm not commenting on whether the idea is sound. But to hide css from
IE, use the child selector.

.ifIE { display: block }
.ifNotIE { display: none }

body>div.ifIE { display: none }
body>div.ifNotIE { display: block}


Thanks. Only good till IE 7, though, right? :-)


Works nicely now with IE6, Mozilla, and Opera. I'm using * instead of
"body", though, since the items aren't at the top level. There isn't
any problem with that, is there?

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 20 '05 #4

P: n/a
Harlan Messinger wrote:
Works nicely now with IE6, Mozilla, and Opera. I'm using * instead of
"body", though, since the items aren't at the top level. There isn't
any problem with that, is there?


Yes. There is. IE5.0 can give problems ;-)

Use the parent-element and you are always save.
--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #5

P: n/a
On Mon, 26 Jan 2004 22:45:25 -0500, Harlan Messinger
<hm*******************@comcast.net> wrote:
I would like to use this single page on all browsers. On IE, I'd like
the div to appear and the textarea to be hidden, and vice versa on
other browsers. Suppose I assign the textarea to a class called "ifIE"
and the div to a class called "ifNotIE". What kind of kludge will
result in

.ifIE { display: block; }
.ifNotIE {display: none; }

in IE and

.ifIE { display: none; }
.ifNotIE {display: block; }

elsewhere?


Never used them myself, but there's a beast called IE conditional
comments which should help. Googling c.i.w.a.* should produce the
syntax.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #6

P: n/a

"Anne van Kesteren" <ma**@annevankesteren.nl> wrote in message
news:bv**********@reader08.wxs.nl...
Harlan Messinger wrote:
Works nicely now with IE6, Mozilla, and Opera. I'm using * instead of
"body", though, since the items aren't at the top level. There isn't
any problem with that, is there?


Yes. There is. IE5.0 can give problems ;-)

Use the parent-element and you are always save.


Thanks for the advice. If it turns out to be necessary, I can make the
selectors more specific. Fortunately, this application is entirely within my
control, and there are only about half a dozen users! I've already told them
"it may work in IE 5.5, probably won't work in IE 5, and definitely won't
work in IE older than that". If that really causes anyone a problem, then I
can adjust the selectors.

As a compromise that would retain some generality (that is, not require me
to check what the parent element is in each case), would this work:

body>* div.isIE

? I think this would then ignore elements that *are* directly children of
the body, but I'm not applying this technique to any of them. If I were then
I could add have both selectors:

body>div.isIE
body>* div.isIE

Jul 20 '05 #7

P: n/a

"Stephen Poley" <sb******************@xs4all.nl> wrote in message
news:7a********************************@4ax.com...
On Mon, 26 Jan 2004 22:45:25 -0500, Harlan Messinger
<hm*******************@comcast.net> wrote:
I would like to use this single page on all browsers. On IE, I'd like
the div to appear and the textarea to be hidden, and vice versa on
other browsers. Suppose I assign the textarea to a class called "ifIE"
and the div to a class called "ifNotIE". What kind of kludge will
result in

.ifIE { display: block; }
.ifNotIE {display: none; }

in IE and

.ifIE { display: none; }
.ifNotIE {display: block; }

elsewhere?


Never used them myself, but there's a beast called IE conditional
comments which should help. Googling c.i.w.a.* should produce the
syntax.


Thanks, I'll take a look.

Jul 20 '05 #8

P: n/a
Harlan Messinger wrote:
Fortunately, this application is entirely within my
control, and there are only about half a dozen users!
Require them to upgrade to IE6 ;-)

As a compromise that would retain some generality (that is, not require me
to check what the parent element is in each case), would this work:


Check for yourself: <http://www.skyzyx.com/archives/000094.php>


--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #9

P: n/a
Anne van Kesteren <ma**@annevankesteren.nl> wrote:
Harlan Messinger wrote:
Fortunately, this application is entirely within my
control, and there are only about half a dozen users!


Require them to upgrade to IE6 ;-)

As a compromise that would retain some generality (that is, not require me
to check what the parent element is in each case), would this work:


Check for yourself: <http://www.skyzyx.com/archives/000094.php>


Wow, that's really taking a chance, isn't it? Now, if I had an
expendable machine ....

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 20 '05 #10

P: n/a
On Thu, 29 Jan 2004 22:54:36 -0500, Harlan Messinger
<hm*******************@comcast.net> wrote:
Anne van Kesteren <ma**@annevankesteren.nl> wrote:
Harlan Messinger wrote:
Fortunately, this application is entirely within my
control, and there are only about half a dozen users!


Require them to upgrade to IE6 ;-)

As a compromise that would retain some generality (that is, not require me
to check what the parent element is in each case), would this work:


Check for yourself: <http://www.skyzyx.com/archives/000094.php>


Wow, that's really taking a chance, isn't it? Now, if I had an
expendable machine ....


It's been on my list of things to try for a few weeks. Has anyone else
here tried it?

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #11

P: n/a
Stephen Poley wrote:
Check for yourself: <http://www.skyzyx.com/archives/000094.php>


It's been on my list of things to try for a few weeks. Has anyone else
here tried it?


Works like a charm (XP).

--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #12

P: n/a
On Fri, 30 Jan 2004 12:50:19 +0100, Stephen Poley
<sb******************@xs4all.nl> wrote:
Check for yourself: <http://www.skyzyx.com/archives/000094.php>


Wow, that's really taking a chance, isn't it? Now, if I had an
expendable machine ....


It's been on my list of things to try for a few weeks. Has anyone else
here tried it?


I can have all 3 running simultaneously on W97. The only drawback is they
all 'appear' to be IE6 but the behavior is appropriate to the actual
versions they are. So you need to keep track of which one is which when
you have more than one version open.
Jul 20 '05 #13

P: n/a

"Anne van Kesteren" <ma**@annevankesteren.nl> wrote in message
news:bv**********@reader11.wxs.nl...
Stephen Poley wrote:
Check for yourself: <http://www.skyzyx.com/archives/000094.php>


It's been on my list of things to try for a few weeks. Has anyone else
here tried it?


Works like a charm (XP).


Besides safety, I'm concerned about reliability. Are you certain that the
behavior you're seeing in each "version" is identical to the behavior that
that version exhibits when installed by itself?

Jul 20 '05 #14

P: n/a
On Fri, 30 Jan 2004 10:12:43 -0500, Harlan Messinger
<h.*********@comcast.net> wrote:

"Anne van Kesteren" <ma**@annevankesteren.nl> wrote in message
news:bv**********@reader11.wxs.nl...
Stephen Poley wrote:
>>>Check for yourself: <http://www.skyzyx.com/archives/000094.php>
>
> It's been on my list of things to try for a few weeks. Has anyone else
> here tried it?
>


Works like a charm (XP).


Besides safety, I'm concerned about reliability. Are you certain that the
behavior you're seeing in each "version" is identical to the behavior
that
that version exhibits when installed by itself?

This is more technical than I can explain adequately, but the only parts
removed from the installation are things which prevent side-by-side
installation. The only real issue I know of is that I'm told attempting to
access Favorites will crash it.
Jul 20 '05 #15

P: n/a
Harlan Messinger wrote:

As a compromise that would retain some generality (that is, not
require me to check what the parent element is in each case), would
this work:

body>* div.isIE


I don't know, but this would:

html>body .isIE
html>body .isNotIE

--
Brian (follow directions in my address to email me)
http://www.tsmchughs.com/

Jul 20 '05 #16

This discussion thread is closed

Replies have been disabled for this discussion.