div with flex element floats from right and left code example
Example: float right flex
.parent {
display: flex;
}
.child {
margin-left: auto;
order: 2;
}
.parent {
display: flex;
}
.child {
margin-left: auto;
order: 2;
}