lisovaccaro lisovaccaro - 5 months ago 13
CSS Question

How do I make a semi transparent background?

I need to make a white background 50% transparent without affecting anything else. How do I do it?

Answer

Use rgba():

.transparent{
  background:rgba(255,255,255,0.5);
}

This will give you 50% opacity while the content of the box will continue to have 100% opacity.

If you use opacity:0.5, the content will be faded as well as the background. Hence do not use it.