I'm trying to make a shape from two divs and I'm having trouble preventing the background colors from overlapping.
I manage to do that by applying an opacity to a parent but then all child have that opacity too.
body{background:white;
padding:0px;
margin:0px}
#baz{
opacity:0.5}
#foo{
top:10px;
left:60px;
height:80px;
width:200px;
background: black;
position:absolute;
border-radius: 0 40px 40px 0
}
#bar{
height:100px;
width:100px;
background: black;
border-radius:100px;
position:absolute;
}
<div id="baz">
<div id="foo">
</div>
<div id="bar">
</div>
</div>
I therefore tried to apply the opacity to the background only using rgba
body{background:white;
padding:0px;
margin:0px}
#baz{
background-color: rgba(0,0,0,0.5);
}
#foo{
top:10px;
left:60px;
height:80px;
width:200px;
background: inherit;
position:absolute;
border-radius: 0 40px 40px 0
}
#bar{
height:100px;
width:100px;
background: inherit;
border-radius:100px;
position:absolute;
}
<div id="baz">
<div id="foo">
</div>
<div id="bar">
</div>
</div>
And the backgrounds overlapped again...
Any idea on how to do this ?
Thanks