Without any HTML markup provided, I'm assuming the structure is similar to this:
<div class="container">
<div class="box">
<div class="item"></div>
</div>
<div class="box">
<div class="item"></div>
</div>
</div><!-- /.container -->
In your situation, it seems logical that the .item
elements are being displayed as flex items because their parent, the .box
, has a display of flex
. What you might want to do is set the .container
to display flex so that the .box
becomes the flex child.
You can achieve this by doing something like this:
https://jsfiddle.net/disinfor/rd2npn4v/
The first example in the fiddle reflects your current setup, while the second one sets the .container
to display flex.
I hope this aligns with what you need.