Add alpha channel to a given color

I believe there is no way to do it.

Css is very limited by itself, and there isn't much you can do with it.

The only way you could add opacity is:

opacity: 0.5

But the above would also affect the text itself, not only background.

However, you could wrap it in way that would separate the background blocks from the text, so that would keep the color of the text untouched.

EDIT: See the fiddle: http://jsfiddle.net/YfSn7/30/

But that may look somewhat ridiculous, so I wouldn't much advice using it.

Guess you would have to accept that this is impossible, if you do actually want to make things simpler instead of over-complicating them.


If you have Sass:

background-color: rgba(white, 0.5);

Tags:

Css