How can I position the first child under a flex parent, out of the flex calculations, and also set its position as needed?
.mycontainer{
background-color:
rgb(200,200,200);
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
}
.mycontainer-bar{
width: 20px;
height: 20px;
background-color: red;
position: absolute;
/* The following sticks the bar/box to the top-right of the page, not of container */
top: 0px;
right: 0px;
}
.row{
margin: 5px;
background-color: blue;
width: 80%;
height: 90px;
}
<div class="mycontainer">
<div class="mycontainer-bar">t</div>
<div class="row">r1</div>
<div class="row">r2</div>
</div>
I'm trying to make the red box like a toolbar, sticking it to the top-left or top-right of its parent container.
One way around, I can make two children of the container, where the first child would be the toolbar and the second one would be a Flex parent of the required rows. But before I march on that, I really want to if it is possible to make it work out as I want without needing extra html content.