<div class="card">
<img class="image" src="https://assets.codepen.io/3652395/strawberry-juice-png-0.png">
<div class="content">
<h2>About strawberries</h2>
<p>They're red.</p>
<p>Grab yours now!</p>
</div>
</div>
* {
box-sizing: border-box;
}
.card {
background-color: rgb(255, 255, 255);
border-radius: 4px;
overflow: hidden;
display: flex;
align-items: center;
flex-direction: column;
-moz-box-pack: justify;
justify-content: space-between;
box-shadow: rgba(12, 15, 20, 0.02) 0px 0px 0px 1px,
rgba(12, 15, 20, 0.06) 0px 0px 1px 0px,
rgba(12, 15, 20, 0.06) 0px 2px 2px 0px;
max-width: 344px;
margin: 24px auto;
}
@media (min-width: 768px) {
.card {
flex-direction: row;
max-width: 700px;
}
}
.image {
background-color: #b2eae8;
padding: 16px;
object-fit: contain;
height: 214px;
width: 100%;
}
@media (min-width: 768px) {
.image {
flex-grow: 0;
flex-shrink: 0;
align-self: stretch;
height: 184px;
width: 318px;
}
}
.content {
width: 100%;
padding: 24px;
}
h2 {
font-family: sans-serif;
color: #333333;
}
p {
font-family: sans-serif;
color: #333333;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.