Skip to content Skip to sidebar Skip to footer

Nested Flexboxes And Items Alignment

I'm trying to create my own small grid system based on CSS3 flex display. I basically have the following classes: a grid class, which is a flex container with flex-direction set t

Solution 1:

The property that controls how the children are aligned along the main axis is justify-content

.align-end {
    justify-content: flex-end;
}

plunker


Solution 2:

is this whats you're going for? http://plnkr.co/edit/bFWMSQ7qj4Cuomzm0Ptv?p=preview

Looks like you had 2 column-1 class in the first row

  <!-- first row -->
  <div class="row align-end"> <!-- try to remove 'align-end' here -->
    <div class="column-1">
      <div class="item">1</div>
    </div>

    <div class="column-1">
      <div class="item">2</div>
    </div>
  </div>

********edit*********

after some digging i think i know what you mean. you are trying to left align the first box and right align the second box leaving a blank in the middle.

if you add margin-left: auto; it takes care of the rest of the space left in the row. http://plnkr.co/edit/1Eoeh4uOik3BIZHsL9bH?p=preview

i added it to the align-end class so whenever you use align-end, it will add the margin-left:auto; to that box.


Post a Comment for "Nested Flexboxes And Items Alignment"