JSFiddle - React, Tailwind, and code Playground
by phloe
HTML
<div class="page">
<div class="teaser">
<div class="media">
<div class="media__image">
<img src="https://fillmurray.com/800/450" />
</div>
<span class="media__label">></span>
</div>
<div class="text">
<h3>I don't want to be that guy mumbling into his drink at a bar</h3>
</div>
</div>
</div>
CSS
html,
body {
min-height: 100%;
}
body {
background: linear-gradient(-45deg, #FFF, #666);
}
.page {
max-width: 640px;
margin: 0 auto;
}
.media {
position: relative;
}
.media__image {
position: relative;
-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 30px, 30px 30px, 30px 0);
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 30px, 30px 30px, 30px 0);
overflow: hidden;
}
.media__image:after {
content: "";
display: block;
padding-bottom: 56.25%;
background-color: rgba(0, 0, 0, 0.1);
}
.media__image img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.media__label {
position: absolute;
top: 0;
left: 0;
background-color: #FFF;
display: block;
width: 30px;
height: 30px;
text-align: center;
font-weight: bold;
line-height: 30px;
}
@supports (clip-path: polygon(0 0, 100% 0, 0 100%)) or (-webkit-clip-path: polygon(0 0, 100% 0, 0 100%)) {
.media__label {
background-color: transparent;
}
}
.text {
padding: 20px;
background-color: #FFF;
}