Achieving white opacity effect in html/css

Jack picture Jack · Oct 19, 2010 · Viewed 110.5k times · Source

is there a way to achieve this effect in a cross-browser compatible way without having to prepare separated images?

Basically the frame on which text lays has a white overlay of 50% opacity.. I would like a solution that doesn't involve creating any other image in addition to the background but I don't know if it's possible!

alt text

Answer

Bobby Jack picture Bobby Jack · Oct 19, 2010

Try RGBA, e.g.

div { background-color: rgba(255, 255, 255, 0.5); }

As always, this won't work in every single browser ever written.