JSFiddle - React, Tailwind, and code Playground
by Gregor Adams
HTML
<div id="foo">
<div id="bar">Yes we can
</div>
can we both be opaque with nice markup?
</div>
CSS
body{background:green;}
#foo{
height:50px;
width:250px;
background:rgba(0, 0, 0, 0.6);
position:absolute;
left:150px;
top:150px;
color: #fff;
padding:50px;
}
#foo:before{
content: '';
height:200px;
width:200px;
background-image: -webkit-linear-gradient(transparent 50%, rgb(0, 0, 0) 50%, rgb(0, 0, 0)),
-webkit-linear-gradient(0deg, transparent 50%, rgb(0, 0, 0) 50%, rgb(0, 0, 0));
opacity: 0.6;
-webkit-transform: rotate(180deg);
border-radius:200px;
position:absolute;
top:-100px;
left:-100px;
color: #fff;
}
#bar {
position:absolute;
top:-100px;
left:-100px;
padding:50px;
width: 100px;
height:100px;
}