Skip to content

Instantly share code, notes, and snippets.

@jque
Created September 30, 2015 10:57
Show Gist options
  • Select an option

  • Save jque/b4978c345141aede019d to your computer and use it in GitHub Desktop.

Select an option

Save jque/b4978c345141aede019d to your computer and use it in GitHub Desktop.
PPWKpy
<ul class="flex-container">
<li class="flex-item">1</li>
<li class="flex-item">2</li>
<li class="flex-item">3</li>
<li class="flex-item">4</li>
<li class="flex-item">5</li>
<li class="flex-item">6</li>
</ul>
.flex-container {
padding: 0;
margin: 0;
list-style: none;
display: flex;
flex-wrap: wrap;
}
.flex-item {
background: tomato;
margin-top: 10px;
flex: 0 0 calc(50% - 0.5rem);
color: white;
font-size: 3rem;
font-weight: bold;
text-align: center;
}
.flex-item:nth-child(odd) {
margin-right: 0.5rem
}
.flex-item:nth-child(even) {
margin-left: 0.5rem
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment