0

I have a div with background color as green and opacity as 0.4.

<div id="container" style="background-color:green;opacity:0.4">Text</div>

And I have a text inside the div. When i set the opacity for the div, the innerHTML values is also affected. I want the div background color with opacity 0.4,and the text with normal opacity. Is it possible to achieve my requirement?

Div with text

Thanks in advance

user3326265
  • 257
  • 1
  • 4
  • 14

1 Answers1

1

Manual

<div id="container" style="background-color:rgba(0,200,0,0.4);">Text</div>

Demo

Sadikhasan
  • 18,365
  • 21
  • 80
  • 122