I want to achieve this result using HTML and CSS:

In those cases where the red frame represents large content (PDF content), and around it blue ones are organized. First next to him, and then, when there is enough space, under him.
My HTML structure is as follows, but I can change it:
<div id="outerContainer"> <div id="bigRedBox"></div> <div> <ul id="blueContentList"> <li class="blueContent"></li> <li class="blueContent"></li> <li class="blueContent"></li> <li class="blueContent"></li> <li class="blueContent"></li> </ul> </div> </div>
Now the positioning remains like this:

I do not know if this is possible if you do not configure two containers (one on the side, one below), which I can do, but would make me write a lot of JS.
html css css-position
Marcos lima
source share