I use flexbox
for my layout and after completing Flexbox Froggy I tried to get the following alignment:
My thinking is the following:
- the boxes (
<div>
) need to flow in a column:flex-direction: column;
- they are aligned top-down:
align-content: flex-start;
- one specific box aligns itself to the bottom:
align-self: flex-end;
This leads to the HTML code below (also available on JSFiddle)
<div class="container">
<div class="box1">
box 1
</div>
<div class="box2">
box 2
</div>
<div class="box3">
box 3
</div>
</div>
with the CSS
.container {
display: flex;
flex-direction: column;
align-content: flex-start;
}
.box3 {
align-self: flex-end;
}
But it does not work - it looks like to third box is pushed (flex-end
) to the right and not to the bottom.
My understanding was that align-self
handles an exception relative to the container ("the container aligns everything from the top, but I, myself, will align to the bottom"). Isn't that so?