I'm pretty new to Flexbox, but I'm using it in a web project to move embedded video players around in a <div>
element using the order
property. It works perfectly for this. This is all displayed on one line. In the diagram below, those video players are in the "on deck" area, in a <div>
with flex-direction: row
.
My web application is laid out like this (roughly):
CONTAINER - flex direction column.
---------------------------------------------------------
| | "menu bar"
---------------------------------------------------------
| iframe. Flex 6 | iframe. Flex 1 | "main area"
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
---------------------------------------------------------
| iframe | iframe | iframe | iframe | "on deck" area
| | | | |
| | | | |
---------------------------------------------------------
Each of those areas named on the right of the diagram is a <div>
with flex-direction: row
.
What I'm hoping to accomplish is to combine the "main area" and "on deck area" into a single div flex row, and to always have the two iframes currently in the "main area" show up on one line, with all of the iframes in the "on deck" area below it. So the flex 6 iframe would be order 0, the flex 1 iframe next to it would be order 1, and everything below it would be order 2, 3, etc. That way, those iframes could be moved into and out of that "main" area without having to reload, which has a performance hit I'd like to avoid if I can by changing each iframe's order.
I know there's a property called flex-wrap
which can let elements in a single div wrap to the next line if they don't fit. I'm having trouble wrapping my head around this.
My question is - is there some way I can force flex iframes to always appear on the first line of a div where flex-wrap
is set to wrap
?