I am working with a div that is generated by a library. This div contains 2 child divs with varying heights, which can change based on the API response and the width of the browser window.
My goal is to display another div (my-div
) between top-bar
and bottom-bar
.
<div class="my-div">
My content with a fixed height
</div>
<div class="library-output">
<div class="top-bar">Content here with unknown height</div>
<div class="bottom-bar">More content here with unknown height</div>
</div>
I am unable to alter the library or its output using JavaScript (as it is a third-party React application). I do know the class names of all the divs beforehand.
Is it possible to achieve this layout using CSS alone? I am considering adding a margin-bottom to top-bar
to create space, but I am having trouble with positioning my-div
.