<div id=“parent”>
<div id = "child1">
<img src="123"/>
</div>
<div id = "child2">
<p> Some text1 </p>
<p> Some text2 </p>
</div>
</div>
In my HTML structure, the parent div has a fixed height and always contains two child containers:
- The first child container is a div with an image.
- The second child container is a div with some data.
Sometimes, the size of the image inside the first child container varies. When the image is larger, it occupies more space in #child1
which results in the text in #child2
being partially hidden. I can see the "Some text1" paragraph but not "Some text2".
I am looking for a solution to make the image inside #child1
always take up the same percentage of space within #parent
, possibly by zooming it in proportionally.