2

How can I achieve get some element to the very end of the flexbox div?

enter image description here

#wrap {
    display: flex;
}
.right {
  align-self: flex-end;
}

Here is codepen http://codepen.io/anon/pen/OMEgJO

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
Karolina Ticha
  • 531
  • 4
  • 19
  • Note that `align-self` moves flex items along the *cross axis*, which would be vertical in your case (`flex-direction: row`). So `align-self: flex-end` would move the item down, not right. Since you're trying to align the item to the right on the *main axis*, here are some options: http://stackoverflow.com/a/33856609/3597276 – Michael Benjamin Jan 30 '16 at 16:17
  • 3
    Possible duplicate of [Right-aligning flex item?](http://stackoverflow.com/questions/22429003/right-aligning-flex-item) – Michael Benjamin Jan 30 '16 at 16:22

1 Answers1

3

.right { align-self: flex-end; margin-left: auto; }

margin-left:auto should do it

doron aviguy
  • 2,554
  • 2
  • 22
  • 18