[thelist] [CSS] - semi transparent background colour, with solid text...?

Tris beertastic at gmail.com
Mon Dec 1 04:23:46 CST 2008


Hi all..
I've been given a PS file to cut up and HTML-ify...
I'm a PHP bod, so I'm a little outta my depth here, but I'm getting there..

Anyhoo..
The main page title is white text, sitting on a semi transparent black
background, so you can see the large background image (on the body
tag).
When I use opacity in my CSS file, it works great, but apparently
opacity  is inherited  and the white text becomes transparent too.

I've got my divs like this:

<div id="titleContainer">
  <div id="titleText">
   My title
  </div>
</div>

and CSS:
#titleContainer {
  background-color: #000;
  filter:alpha(opacity=93);-moz-opacity:.93;opacity:.93;
}
#titleText{
  color: #fff;
  filter:alpha(opacity=100);-moz-opacity:.100;opacity:.100;
}

Is there anyway to have Solid text, that's within a transparent Div???



-- 
"The only people who don't make mistakes are those who don't do anything"

Give a man a fish and he'll feed himself for a day.
Give a man a religion and he'll starve to death praying for a fish.
Anon

`We are what we pretend to be, so we must be careful what we pretend to be.`
Kurt Vonnegut

`When a person can no longer laugh at himself, it is time for others
to laugh at him.`
Thomas Szasz



More information about the thelist mailing list