3

i have two div-tags

<div class="1" style="opacity:0.5">
  <div class="2"></div>
</div>

Div1 do have a opacity so div2 also have a opacity.

What can i do to disable opacity in div2?

Div2 have to be in div1 so i cannot change the order of the divs.

Rudi Ebner
  • 33
  • 1
  • 4
  • Do you want to do something to prevent any sort of opacity in _div2_, so that if _div1_ is transparent, _div2_ shouldn't have any opacity (transparency). – Ahmad Baktash Hayeri Aug 24 '15 at 09:29

1 Answers1

3

If you want opacity to lighten the background color of Div1, you may use following css.

<div class="1" style="background: rgba(255, 0, 0, 0.5);">

It will then not affect your Div2 content.

Note: One should use external css file to write css instead inline css. I've used the same just to better help you on your issue.

Ravi Khandelwal
  • 718
  • 1
  • 5
  • 15