M
M
malayamarisha2020-05-13 08:10:03
css
malayamarisha, 2020-05-13 08:10:03

How to stretch image to full column bootstrap 4?

Good day!
There is a block with columns. An image is displayed in these columns. Images can be of different widths/heights.
Please tell me how you can stretch the image to the entire column, regardless of the width / height.
img-responsive doesn't help

<? foreach ($arResult["ITEMS"] as $arItem): ?>
        <div class="col-lg-4">
            <div class="wrap_images">
                <? if ($arParams["DISPLAY_PICTURE"] != "N" && is_array($arItem["PREVIEW_PICTURE"])): ?>
                    <? if (!$arParams["HIDE_LINK_WHEN_NO_DETAIL"] || ($arItem["DETAIL_TEXT"] && $arResult["USER_HAVE_ACCESS"])): ?>
                        <a href="<?= $arItem["DETAIL_PAGE_URL"] ?>">
<img class="img-responsive" src="<?= $arItem["PREVIEW_PICTURE"]["SRC"] ?>" alt="<?= $arItem["PREVIEW_PICTURE"]["ALT"] ?>" title="<?= $arItem["PREVIEW_PICTURE"]["TITLE"] ?>"/>
                        </a>
                    <? else: ?>
                        <img class="img-responsive" src="<?= $arItem["PREVIEW_PICTURE"]["SRC"] ?>" alt="<?= $arItem["PREVIEW_PICTURE"]["ALT"] ?>" title="<?= $arItem["PREVIEW_PICTURE"]["TITLE"] ?>"/>
                    <? endif; ?>
                <? endif ?>
            </div>
        </div>
    <? endforeach; ?>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
drawnofmymind, 2020-05-13
@malayamarisha

object-fit: cover

S
sashabeep, 2020-05-13
@sashabeep

.w-100 still have class

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question