<div class="red">Normally aligned</div>
<div class="blue-wrapper">
  <div class="green">in flex</div>
  <div class="blue">Aligned right with flex</div>
</div>
.red, .blue, .green {
  height: 200px;
  width: 200px;
  color: #fff;
  text-align: center;
}

.red {
  background-color: red;
}

.blue {
  background-color: blue;
  margin: 0 0 0 auto;
}

.green {
  background-color: green;
}

.blue-wrapper {
  display: flex;
  flex-direction: row;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.