Skip to content

Instantly share code, notes, and snippets.

@Lysindr
Created August 9, 2016 11:17
Show Gist options
  • Save Lysindr/85ac74e839136de71855fb7f729966b7 to your computer and use it in GitHub Desktop.
Save Lysindr/85ac74e839136de71855fb7f729966b7 to your computer and use it in GitHub Desktop.
Flex grid
<div class="grid">
<div class="grid__row">
<div class="grid__item">
<div class="item">
<p>Hello</p>
<a href="#">Click</a>
</div>
</div>
<div class="grid__item">
<div class="item">
<p>Hello</p>
<a href="#">Click</a>
</div>
</div>
</div>
<div class="grid__row">
<div class="grid__item">1</div>
<div class="grid__item">2</div>
<div class="grid__item">3</div>
</div>
<div class="grid__row">
<div class="grid__item">1</div>
<div class="grid__item">2</div>
<div class="grid__item">3</div>
<div class="grid__item">4</div>
</div>
</div>
body {
padding: 80px;
}
.grid {
border: solid 1px #e7e7e7;
}
.grid__row {
display: flex;
}
.grid__item {
flex: 1;
padding: 12px;
border: solid 1px #e7e7e7;
}
.item {
max-width: 200px;
display: flex;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment