Skip to content

Instantly share code, notes, and snippets.

Last active December 7, 2020 10:41
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mojavelinux/10078846ecc2772112420c7293c3d0ca to your computer and use it in GitHub Desktop.
Flexbox alignment challenge: How do we get the green boxes to be flush with the right margin while keeping the wrap behavior the same?
<!DOCTYPE html>
.container {
border: 3px solid blue;
width: 250px;
display: flex;
justify-content: space-between;
.left {
flex: none;
padding: 0.2em 0;
.right {
display: flex;
flex-wrap: wrap;
margin-top: -0.5em;
.box {
background-color: green;
color: white;
margin: 0.5em 0 0 0.5em;
padding: 0.2em;
<div class="container">
<div class="left">
<span>Project Name</span>
<div class="right">
<span class="box">1.0</span>
<span class="box">2.0</span>
<span class="box">3.0</span>
<span class="box">4.0</span>
<span class="box">5.0</span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment