I am currently utilizing Bootstrap 4.6 and WordPress along with the ACF Plugin, and I find myself in need of assistance. I am facing an issue where the height of a row in a section needs to adjust according to the content within a column, but the image within the column is causing the row to expand uncontrollably, resulting in excessive space at the bottom. The challenge is that the content and image within the section are dynamic, meaning that a fixed max height cannot solve the problem.
Image 1: Representing the top of the section
Image 2: Depicting the bottom of the section
Image 3: Showing the additional space at the bottom of the section
<section id="about">
<div class="about-section position-relative overflow-hidden" style="background: linear-gradient(180deg, #00AEA0 0%, rgba(0, 131, 120, 0.5) 118.6%);">
<img class="position-absolute bottom-0 right-0" src="<?php bloginfo('template_directory'); ?>/assets/img/about-us-background.png" style="max-width: 50%;">
<div class="row">
<div class="col-12 col-lg-4 px-0">
<?php if (get_field('about_image')) : ?>
<img class="w-100 h-100 object-cover d-none d-lg-block" src="<?php the_field('about_image');; ?>">
<?php endif; ?>
</div>
<div class="col-12 col-lg-6 offset-lg-1">
<div class="px-4 px-lg-0 py-5 py-md-6">
<h1 class="title text-lg-left"><?php the_field('about_title'); ?></h1>
<div class="text-md-justify mt-4">
<?php the_field('about_text'); ?>
</div>
<a href="<?php the_field('about_button_link'); ?>" class="btn-custom btn-blue-1 mt-3 px-4 px-md-5"><?php the_field('about_button_text'); ?></a>
<div class="row gap-8 gap-lg-4 mt-5">
<?php if (have_rows('benefits')) : ?>
<?php while (have_rows('benefits')) : the_row(); ?>
<div class="col-12 col-sm">
<div class="d-flex flex-column gap-4">
<div class="hover-flip">
<div class="benefit-icon">
<?php if (get_sub_field('image')) : ?>
<img src="<?php the_sub_field('image'); ?>">
<?php endif ?>
</div>
</div>
<span class="font-weight-bold text-lg"><?php the_sub_field('name'); ?></span>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</section>
I have attempted using CSS properties such as "
width: 100%; height: 100%; object-fit: cover;
" on the image, but it has not provided the desired outcome.