CSS - push list to right or left in flex container

0 votes
111 views
added Feb 20 in CSS by lcjr First Warrant Officer (11,780 points)

To push a list to the right within a flex container, you can use the justify-content property set to flex-end. Here's an example:

.flex-container {
  display: flex;
}

.list-left,
.list-right {
  flex: 0 0 50%; 
  justify-content: flex-start;
}

.list-right {
  flex: 0 0 50%; 
  justify-content: flex-end;
}

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...