1

I don't understand why flexbox container, normally working ONLY on direct child, can work on this kind of structure:

<div class="flex-container">
    <div class="row"> 
        <div class="flex-item">1</div>
        <div class="flex-item">2</div>
        <div class="flex-item">3</div>
        <div class="flex-item">4</div>
    </div>
</div>

taken from topic stackoverflow. Direct child of flex container is div.row, so how it could works on div.flex-items?

Community
  • 1
  • 1
ClassicError
  • 175
  • 1
  • 1
  • 9
  • 1
    You are correct. Flex properties only work between parent and child. In the [referenced post](http://stackoverflow.com/questions/19026884/flexbox-center-horizontally-and-vertically), there are no flex properties working on `.flex-item`. The class name implies that the element is a flex item, but it is not. The name causes confusion. The only way `flex-item` can accept flex properties is if the parent (`.row`) had `display: flex` or `display: inline-flex`. – Michael Benjamin Nov 26 '16 at 02:25

0 Answers0