Opacity of overlapping partially transparent elements

if you have one <div> element with opacity .5 and another <div> element that overlays the first with the same opacity, then what is the opacity of the two elements?
This is not true,

  • .5 × .5

and does not exist

  • .5 +.5

How to calculate such a problem?

+2
source share
1 answer

I believe the formula you are looking for will be 1- (x × y)

+4
source

Source: https://habr.com/ru/post/1434019/


All Articles