0

I have a container that uses flex like a navbar so i have left and right items using space between property. My issue is that sometimes the left items are non existent and I would like the right items to stay on the right side still. Here is an example:

<div class="container">
  <div>
  Stay on left
  </div>
  
  <div>
  Stay on right
  </div>
</div>

.container {
  display: flex;
  justify-content: space-between;
}

When I remove the stay on left div I still need the stay on right div to stay on the right side of the container

ousmane784
  • 306
  • 1
  • 17

1 Answers1

-1

    <div class="container">
  <div>
  Stay on right
  </div>
  
  <div>
  Stay on left
  </div>
</div>

.container {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
}
nickfury
  • 29
  • 3