Answer the question
In order to leave comments, you need to log in
How to dynamically change the height of an empty block?
I ran into a small problem, according to the draft link: usagid.com/pages/hotel/hotel_result.html
In the block with the establishment, when the width of the browser window changes, only the width of the block with the picture changes (the picture is set as a background, the block itself is empty).
I tried everything I knew, even the clientWidth property in js did not help me in order to somehow automate this, since it writes the current value to the variable and when the window is further resized, the ratio remains the same.
I will be glad to any solution to this problem, everything will be interesting for educational purposes)
Answer the question
In order to leave comments, you need to log in
div.some-block{
background:url('some.img')no-repeat center;
background-size: contain;
}
The picture should not be written as a background, but pushed into html.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question