align-self: flex-end;
only goes “column”, in your case you have two options:
-
justify-content: space-between;
on.container
, fiddle -
remove the
align-self
on both elements and usemargin-left: auto;
on.b
, fiddle
.container {
border: 2px solid;
height: 500px;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.box {
border: 1px solid;
height: 200px;
width: 50px;
}
.a {
background-color: red;
}
.b {
background-color: cyan;
}
.container {
border: 2px solid;
height: 500px;
display: flex;
flex-direction: row;
}
.box {
border: 1px solid;
height: 200px;
width: 50px;
}
.a {
background-color: red;
}
.b {
background-color: cyan;
margin-left: auto;
}
EDIT
now that you edited your question to be 3 boxes you can have a look at this fiddle,
.a {
background-color: red;
}
.b {
background-color: cyan;
}
.c {
background-color: deepskyblue;
margin-left: auto;
}