I am striving to optimize this section for responsiveness. It looks fantastic on larger viewports, but as we start shrinking down, for instance, on a viewport around 930px, I'm facing difficulty in keeping the image perfectly aligned as shown in the initial screenshot.
I have experimented with setting the photo area to background-size: cover
, but unfortunately, this solution ends up cropping the edges of the image on smaller viewports, which is not ideal.
The second issue arises when viewing on a mobile screen: these two blocks need to stack vertically. I am confident that I can tackle this issue once the primary problem is resolved.
<section class="card-group">
<div class="card">
<img src="..." class="img-fluid">
</div>
<div class="card card-vcenter">
<div class="card-block">.....</div>
</div>
</section>
.card-vcenter{
display: flex;
align-items: center;
justify-content: center;
}
Thank you in advance for your help!