Last active
August 28, 2017 10:17
-
-
Save xxjinwei/abfd0c7d29e8216096c7731db883e956 to your computer and use it in GitHub Desktop.
equel height colum by flex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.con { | |
display: flex; | |
flex-wrap: wrap; | |
align-items: stretch; /* default value */ | |
} | |
.item { | |
width: 33.333%; | |
margin-bottom: 10px; | |
background-color: tomato; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
align-items: stretch
born to equal height