1

i want to make a div transparent who have backgound-color:#5A7D00. Actually i want to achieve this result which i want

enter image description here

but i am not able to achieve this.Please help me with some code to achieve (avoid res strips)

Sagar Kodte
  • 3,723
  • 4
  • 23
  • 52
Arpit Gupta
  • 17
  • 3
  • 8

2 Answers2

3

You need to convert the color to rbg so you can use it with the rgba() property.

In this case, what you are after is:

background-color: rgba(90, 125, 0, 0.5);

The last of those 4 values being the opacity level (0.5)

Jack Ducasse
  • 479
  • 1
  • 4
  • 9
1

You must convert the Hex Color Format to RBG Color format as this format includes Alpha Transparency. Which allows us to make only parent container transparent without changing the transparency of the child containers. In RBG format first 3 values are RBG color values and fourth is the Opacity value ranging between 0 to 1.

So your code should look like :

background-color: rgba(90, 125, 0, 0.5);