<section class="grid">
<article class="card">
<div class="card-inner">
<div class="icon"></div>
<div class="content">
<h3>Title</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Illum nostrum veritatis natus earum similique expedita!</p>
</div>
</div>
</article>
<article class="card">
<div class="card-inner">
<div class="icon"></div>
<div class="content">
<h3>Title</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Illum nostrum veritatis natus earum similique expedita!</p>
</div>
</div>
</article>
<article class="card">
<div class="card-inner">
<div class="icon"></div>
<div class="content">
<h3>Title</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Illum nostrum veritatis natus earum similique expedita!</p>
</div>
</div>
</article>
<article class="card">
<div class="card-inner">
<div class="icon"></div>
<div class="content">
<h3>Title</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Illum nostrum veritatis natus earum similique expedita!</p>
</div>
</div>
</article>
</section>
@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500&display=swap');
*{
font-family: 'Work Sans', sans-serif;
box-sizing: border-box;
line-height:1.5;
}
.grid{
width: 100%;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: 1fr;
grid-column-gap: 2rem;
grid-row-gap: 2rem;
padding:1rem;
box-sizing: border-box;
}
@media (max-width: 900px){
.grid{
grid-template-columns: repeat(1, 1fr);
}
}
.card{
width:100%;
background: #ddd;
border-radius : 0.5rem;
container-type: inline-size;
.card-inner{
display:flex;
flex-direction:row;
align-items: start;
justify-content: start;
gap:1rem;
padding:2rem 1rem;
}
.icon{
width: 100px;
height:100px;
display:block;
background:#aaaaaa;
border-radius:50%;
}
.content{
width:calc(100% - 100px);
}
h3{
line-height:1.1;
margin:0;
}
}
@container (max-width: 600px) {
.card-inner {
flex-direction:column;
flex-wrap:wrap;
.content{
width:100%;
}
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.