471,336 Members | 1,022 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,336 software developers and data experts.

opacity and IE

I have a p tag defined as
..nav_current
{
opacity:.5;
}

which works fine in Mozilla, but IE doesn't act on it. Any way to get it
to work?

--
Amer Neely
w: www.webmechanic.softouch.on.ca/
Perl | MySQL programming for all data entry forms.
"Others make web sites. We make web sites work!"
Aug 26 '07 #1
4 2955
Amer Neely wrote:
I have a p tag defined as
.nav_current
{
opacity:.5;
}

which works fine in Mozilla, but IE doesn't act on it. Any way to get
it to work?
If you had bothered to try doing a Google search for the terms "ie" and
"opacity" the first result would have told you that you need to do:

..nav_current
{
filter: alpha(opacity=50);
opacity:.5;
}
Aug 27 '07 #2
Nik Coughlin wrote:
Amer Neely wrote:
>I have a p tag defined as
.nav_current
{
opacity:.5;
}

which works fine in Mozilla, but IE doesn't act on it. Any way to get
it to work?

If you had bothered to try doing a Google search for the terms "ie" and
"opacity" the first result would have told you that you need to do:

.nav_current
{
filter: alpha(opacity=50);
opacity:.5;
}

Presumptuous of you to assume I hadn't.

I have the old Mandarin Design code as well, and it still doesn't want
to work. I've tried inline CSS as well as an external file.

..nav_current
{
color:black;
background-color:#9CCFC8;
filter:alpha(opacity=50);
opacity:.5;
-moz-opacity:.50;
}

<p class="nav_current">Home </p>
--
Amer Neely
w: www.webmechanic.softouch.on.ca/
Perl | MySQL programming for all data entry forms.
"Others make web sites. We make web sites work!"
Aug 27 '07 #3
Amer Neely wrote:
Nik Coughlin wrote:
>Amer Neely wrote:
>>I have a p tag defined as
.nav_current
{
opacity:.5;
}

which works fine in Mozilla, but IE doesn't act on it. Any way to
get it to work?

If you had bothered to try doing a Google search for the terms "ie"
and "opacity" the first result would have told you that you need to
do: .nav_current
{
filter: alpha(opacity=50);
opacity:.5;
}


Presumptuous of you to assume I hadn't.
My apologies then.
I have the old Mandarin Design code as well, and it still doesn't want
to work. I've tried inline CSS as well as an external file.

.nav_current
{
color:black;
background-color:#9CCFC8;
filter:alpha(opacity=50);
opacity:.5;
-moz-opacity:.50;
}

<p class="nav_current">Home </p>
Seems to be some variant of the HasLayout bug.

Can be fixed with Holly hack:

<style type="text/css">
..nav_current
{
color: black;
background-color: #9CCFC8;
opacity: 0.5;
}
</style>
<!--[if lte IE 7]>
<style type="text/css">
..nav_current
{
filter: alpha(opacity=50);
height: 1%;
}
</style>
<![endif]-->
<p class="nav_current">Home</p>
Aug 27 '07 #4
Scripsit Nik Coughlin:
>>If you had bothered to try doing a Google search for the terms "ie"
and "opacity" the first result would have told you that you need to
do: .nav_current
{
filter: alpha(opacity=50);
opacity:.5;
}

Presumptuous of you to assume I hadn't.

My apologies then.
There was no need for your apology, since the OP explicitly specified CSS
code that does not contain the IE-specific code, so it was quite logical to
assume ignorance.
> <p class="nav_current">Home </p>

Seems to be some variant of the HasLayout bug.
Probably.
Can be fixed with Holly hack:
...
height: 1%;
With the given information, there's no need to use the tricky version that
illogically sets the height to 1% and relies on the browser implementing it
against the CSS specifications. To give an element "layout" in the odd IE
sense, you can also set its width, and here you could set just width: 100%.
This has the same effect as the default width of auto, in the absence of
other styling, and no other styling was referred to.

It looks odd to call the string "Home " a paragraph, as the OP's markup
does, and maybe it's not the real markup. But the real markup, and the real
CSS code, was not revealed.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Aug 27 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Dean Edwards | last post: by
6 posts views Thread by Robert A. Boudra | last post: by
1 post views Thread by mhoeneveld | last post: by
2 posts views Thread by reidarT | last post: by
16 posts views Thread by Darko | last post: by
15 posts views Thread by Sunny | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.