JSFiddle - React, Tailwind, and code Playground
by Gregor Adams
HTML
<div id="outer">
<div id="inner">
<p>I am pure CSS</p>
<p>I am only one <div> with :before and :after pseudo-elements</p>
</div>
</div>
CSS
body {
background: url('http://lorempixel.com/350/350/sports/3/') repeat;
height:100%;
width:100%;
font-family: Monospace;
}
#outer {
height: 150px;
width: 250px;
position: absolute;
left: 40%;
top: 20%;
color: black;
font-size: 16px;
}
#inner {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
z-index: -1;
background-color: rgba(255,255,0,0.7);
padding:40px 20px 20px 40px;
border-radius: 20px;
border-top-left-radius: 0;
-webkit-box-shadow: 10px 10px 0 rgba(255,0,255,0.7);
}
#inner:before {
content: "";
background-image: -webkit-linear-gradient(transparent 50%, rgb(255,255,0) 50%, rgb(255,255,0)),
-webkit-linear-gradient(0deg, transparent 50%, rgb(255,255,0) 50%, rgb(255,255,0));
height: 100px;
width: 100px;
border-radius: 100px;
position: absolute;
top: -50px;
left: -50px;
-webkit-transform: rotateZ(180deg);
opacity:0.7;
-webkit-box-shadow: 10px 10px 0 rgb(255,0,255);
}
#inner:after {
content: "";
background: url('http://lorempixel.com/50/50/sports/1/') no-repeat;
background-position:0;
height: 50px;
width: 50px;
border-radius: 25px;
position: absolute;
top: -27px;
left: -27px;
-webkit-box-shadow: 0 10px 0 rgb(0,255,255),
0 -20px 0 rgb(0,255,255),
-20px 0 0 rgb(0,255,255),
10px 0 0 rgb(0,255,255);
border: 2px rgb(255,255,255) solid;
}