<div class="card">
<h1 class="card__title">My awesome card</h1>
<p class="card__text">Lorem ipsum dolor sit amet consectetur adipisicing elit. Exercitationem, ipsa sit obcaecati unde quas suscipit molestias ad tempora reiciendis sed est iure perspiciatis! Ducimus, vitae. Sequi aspernatur nulla corrupti voluptates.</p>
</div>
:root {
--primary-color: #5439ab;
}
body {
min-height: 100vh;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
font: 16px 'Segoe UI', Arial, Helvetica, sans-serif;
background: #222222;
}
.card {
--corner-size: 60px;
--border-width: 10px;
position: relative;
width: 320px;
height: 480px;
margin: 40px;
padding: calc(40px + var(--border-width));
box-sizing: border-box;
border-radius: 20px;
background: #ffffff;
clip-path: polygon(
var(--corner-size) 0%,
100% 0%,
100% 100%,
0% 100%,
0% var(--corner-size)
);
box-shadow: inset 0 0 0 var(--border-width) var(--primary-color);
}
.card::after {
position: absolute;
top: 0;
left: 0;
width: var(--border-width);
height: calc(var(--corner-size) * 2);
transform: rotate(45deg) translateY(calc(var(--corner-size) * -0.65));
background: var(--primary-color);
content: '';
}
.card__title {
margin: 0 0 40px 0;
text-align: center;
font-weight: 500;
color: var(--primary-color);
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1), 0 2px 2px rgba(0, 0, 0, 0.1);
}
.card__text {
margin: 0;
text-indent: 2em;
text-align: justify;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.