<div class="wrapper">
<div>
<div class="badge-promo">
<span class="badge-promo-content">
CodePen
</span>
</div>
<div class="card">
<div class="codepen-logo">
<i class="fa fa-codepen" aria-hidden="true"></i> </div>
<p>Demo, or it didn't happen</p>
</div>
</div>
</div>
body {
background: linear-gradient(90deg, #1d8bdd 20%, #6d61b1 80%);
font-family: sans-serif;
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
.card {
background: #fff;
max-width: 450px;
min-width: 350px;
padding: 16px;
border-radius: 2px;
display: flex;
justify-content: center;
flex-direction: column;
text-align: center;
color: #000;
}
.codepen-logo {
font-size: 60px;
}
p {
font-size: 30px;
margin: 8px;
}
// ribbon code
.badge-promo {
position: relative;
overflow: hidden;
max-height: 60px;
margin-bottom: -8px;
z-index: 1;
padding: 12px 14px;
border-radius: 2px 2px 0 0;
color: #fff;
text-align: left;
&:before,
&:after {
content: '';
position: absolute;
top: 0;
left: 0;
}
&:before {
background: #a5daff;
height: 100%;
width: 110%;
transform-origin: bottom right;
transform: rotate(1deg);
}
&:after {
background: #3fb0ff;
transform: rotate(-3deg);
transform-origin: bottom left;
height: 100%;
width: 110%;
}
}
.badge-promo-content {
position: relative;
z-index: 1;
font-family: sans-serif;
font-size: 18px
}
View Compiled
This Pen doesn't use any external JavaScript resources.