<section class="hero">
<div class="content">
<h2>Latest recipes</h2>
<p>
Try our hand-crafted recipes at home and enjoy them with
your loved ones.
</p>
</div>
<div class="visual">
<img class="phone" src="https://i.ibb.co/pyN3wS9/phone.png" alt="" />
<img class="thumb thumb-1" src="https://i.ibb.co/CB5HcVD/cupcake.jpg" alt="" /><img class="thumb thumb-2" src="https://i.ibb.co/Wck9B42/brownies.jpg" alt="" />
</div>
</section>
.hero {
display: flex;
flex-direction: column;
align-items: center;
min-height: clamp(250px, 50vmax, 600px);
background-color: #fff4e5;
padding: 2rem 1rem;
text-align: center;
@media (min-width: 850px) {
flex-direction: row;
justify-content: center;
text-align: initial;
}
> * {
flex: 1;
}
h2,
p {
all: revert;
margin: 0;
}
h2 {
font-size: clamp(1rem, 5vw, 2rem);
margin-bottom: clamp(0.7rem, 2vw, 1rem);
}
.content {
display: flex;
flex-direction: column;
justify-content: center;
padding: 1rem;
}
.visual {
position: relative;
flex: 1.5;
outline: solid 2px rgba(#000, 0.25);
text-align: center;
width: 100%;
max-width: 600px;
border-radius: 20px;
}
img {
border-radius: 12px;
}
.phone {
margin: auto;
width: clamp(11.25rem, 10.341rem + 4.55vw, 13.75rem);
height: auto;
}
.thumb {
position: absolute;
width: clamp(70px, 80px + 15%, 180px);
aspect-ratio: 4 / 3;
object-fit: cover;
box-shadow: 0 3px 10px 0 rgba(#000, 0.2);
}
.thumb-1 {
left: 13%;
left: clamp(1.25rem, -0.341rem + 7.95vw, 5.625rem);
top: 45%;
}
.thumb-2 {
right: 13%;
top: 15%;
}
&.no-clamp {
.thumb {
width: 180px;
}
}
}
*,
*:before,
*:after {
box-sizing: border-box;
}
body {
font-family: "Inter", sans-serif;
line-height: 1.5;
display: flex;
flex-direction: column;
gap: 3rem 0;
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.