Skip to content

Instantly share code, notes, and snippets.

@DreadBoy
Created December 17, 2018 09:06
Show Gist options
  • Save DreadBoy/a7a561dd8deda4809220e2a55c35b01c to your computer and use it in GitHub Desktop.
Save DreadBoy/a7a561dd8deda4809220e2a55c35b01c to your computer and use it in GitHub Desktop.
Flex in columns
<div class="images">
<div class="image"><img src="https://images.unsplash.com/photo-1542321508-2160d24e6c7f"></div>
<div class="image"><img src="https://images.unsplash.com/photo-1537005081207-04f90e3ba640"></div>
<div class="image"><img src="https://images.unsplash.com/photo-1541202060524-fb245ae9b9ec"></div>
</div>
body
margin: 0
.images
column-count: 2
column-gap: 10px
.image
display: flex
align-items: center
justify-content: center
flex-direction: column
border: 2px solid red
.image:not(:last-child)
margin-bottom: 10px
.image img
display: block
width: 100%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment