Skip to content

Instantly share code, notes, and snippets.

@xxjinwei
Last active August 28, 2017 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xxjinwei/abfd0c7d29e8216096c7731db883e956 to your computer and use it in GitHub Desktop.
Save xxjinwei/abfd0c7d29e8216096c7731db883e956 to your computer and use it in GitHub Desktop.
equel height colum by flex
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.con {
display: flex;
flex-wrap: wrap;
}
.item {
width: 33.333%;
margin-bottom: 10px;
background-color: tomato;
}
</style>
</head>
<body>
<div class="con">
<div class="item">1 2 3 4 5 6 7 </div>
<div class="item">1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 </div>
<div class="item">1 2 3 4 5 6 7 </div>
<div class="item">1 2 3 4 5 6 7 </div>
<div class="item">1 2 3 4 5 6 7 </div>
<div class="item">1 2 3 4 5 6 7 </div>
<div class="item">1 2 3 4 5 6 7 </div>
<div class="item">1 2 3 4 5 6 7 8 9 10 11 12 </div>
<div class="item">1 2 3 4 5 6 7 </div>
<div class="item">1 2 3 4 5 6 7 </div>
<div class="item">1 2 3 4 5 6 7 </div>
</div>
<script id="jsbin-source-css" type="text/css">.con {
display: flex;
flex-wrap: wrap;
}
.item {
width: 33.333%;
margin-bottom: 10px;
background-color: tomato;
}</script>
</body>
</html>
.con {
display: flex;
flex-wrap: wrap;
align-items: stretch; /* default value */
}
.item {
width: 33.333%;
margin-bottom: 10px;
background-color: tomato;
}
@xxjinwei
Copy link
Author

xxjinwei commented Aug 28, 2017

align-items: stretch born to equal height

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment