0

I'm working with a background-color which should be 70% transparent, but I have many limitations:

  1. I can't use RGBa or HSLA (I'm getting the colors from a PHP Content Management System) as Hex
  2. The background color is dynamic - I can't use an image
  3. when I use opacity, the text is affected as well making it unreadable.

I'm sure the only option I have is changing my PHP code to generate RGBa colors instead, but asking, do you see any other solution?

enter image description here

George Katsanos
  • 12,901
  • 15
  • 60
  • 92

1 Answers1

0

You can assign a pseudo element to the containing div. Like so:

.container:before{
 opacity:0.5;
}

You could also convert your hex value to RGB and then use that: RGB to Hex and Hex to RGB

Community
  • 1
  • 1
Frisbetarian
  • 1,203
  • 1
  • 10
  • 27