Consider this setup:
- A heading text
- a main content block
All inside a single parent container.
.outer {
max-height: 200px;
background-color: green;
}
.inner {
min-height: 50px;
/*for illustration, default height is set higher than outer's max-height. Normally, it wouldn't exceed*/
height: 250px;
background-color: pink;
}
<div class="outer">
<span> Hi!</span>
<div class="inner"></div>
<!-- Footer placement for demo purposes showing overflow (green bg if within parent div) -->
<!-- Ignore footer for this answer -->
<span> bye! </span>
</div>
How can you ensure that the inner content block dynamically adjusts its size to fit the parent container without overflowing when the header expands?
If the content keeps expanding due to dynamic changes in the header, and there is a risk of overflow, how can you make sure the inner block will resize until it reaches its minimum height before overflowing?
Share your thoughts on achieving this smooth resizing effect.