I am looking to create an element called .errorMessages that can grow to accommodate content (with a div set to overflow-y: auto to display a scrollbar), while still remaining within the boundaries of its parent container.
The structure of the HTML is as follows:
<div class="modalBox"> <!-- this size adjusts based on window -->
<div class="content">
<table class="vtable" style="width: 350px;">
<!-- this should expand, but not surpass the content width -->
...
</table>
<div class="errorMessages flex">
<!-- this should adjust in size, but not exceed the content area -->
<div>
<ul>
<li>an error message</li>
<li>another error message...</li>
<li>another error message...</li>
<li>another error message...</li>
<li>another error message...</li>
<li>another error message...</li>
<li>another error message...</li>
<li>another error message...</li>
</ul>
</div>
</div>
</div>
<div><input type="button" value="Close" class="button blue" />
</div>
</div>
Preview images: https://i.sstatic.net/keQpb.png https://i.sstatic.net/0c9ft.png