Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the problem that the div cannot adapt to the height and cannot change with the height of the picture?

Shulou Source: shulou.com Published: 2022-06-03 08:12:32 11月15日 Update

This article mainly explains "how to solve the problem that div cannot adapt to the height of the picture and cannot change with the height of the picture." interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let the editor take you to learn "how to solve the problem that the div cannot adapt to the height of the picture and cannot change with the height of the picture."

In the column module of a web page, there are several pictures in one, but the height of the div is 0 and cannot change with the height of the picture.

As a workaround, set the overflow property to auto

The code is as follows:

...

At this point, I believe you have a deeper understanding of "how to solve the problem that the div cannot adapt to the height of the picture". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Height pictures changes questions content learning practicality deeper code interests methods practicality practicality attributes simple operation methods more friends columns modules Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Redmi NVidia Shulou Tech Info MySQL