-
CSS and tranparency
I have a CSS for my menu, I wish the background color to be #dedede, but I also want it to be transparent, how do I make that?
Code:
.menu
{
BORDER-RIGHT: buttonhighlight thin outset;
BORDER-TOP: buttonhighlight thin outset;
VISIBILITY: hidden;
BORDER-LEFT: buttonhighlight thin outset;
WIDTH: 150px;
LINE-HEIGHT: 140%;
BORDER-BOTTOM: buttonhighlight thin outset;
POSITION: absolute;
BACKGROUND-COLOR: transparent;
BACKGROUND: #dedede;
}
-
How do you mean? Like semi-transparency? There is no CSS for that yet (not sure if it's in CSS 3), the only thing to do is use one of IEs proprietary filters, and use -moz-opacity to take care of Mozilla, but then your CSS won't validate. THe other alternative is to use a PNG which support alpha transparency. But IE for Win doesn't support it for some reason (see my sig. ;)).
If that's not what you mean you'll have to be more specific.
-
Hi Rick
I've found out, I used the code below.
Code:
.menu
{
BORDER-RIGHT: buttonhighlight thin outset;
BORDER-TOP: buttonhighlight thin outset;
VISIBILITY: hidden;
BORDER-LEFT: buttonhighlight thin outset;
WIDTH: 150px;
LINE-HEIGHT: 140%;
BORDER-BOTTOM: buttonhighlight thin outset;
POSITION: absolute;
BACKGROUND-COLOR: silver;
filter: alpha(opacity=85);
}
-
Yep, that's the MS proprietary stuff. You should also put -moz-opacity: 85% in there too so that it will work in Gecko based browsers.
-
yeah, Ricks right, filter: alpha(opacity=85); is an IE6 addition
-
Is the Mozilla opacity
Code:
filter: moz(opacity=85);
-
no, it's
-moz-opacity: 85%
-
ALso there is a list of all the CSS moz supports at http://lxr.mozilla.org/seamonkey/sou...sCSSPropList.h - proprietary and standard