Created
February 22, 2013 08:13
-
-
Save anthonyringoet/5011693 to your computer and use it in GitHub Desktop.
display:table equal height columns ftw
This file contains hidden or 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
/** | |
* display:table equal height columns ftw | |
*/ | |
body{ | |
font:1.3em/1.4 sans-serif; | |
} | |
.table{ | |
display:table; | |
} | |
.table--row{ | |
display:table-row; | |
} | |
.table--cell{ | |
display:table-cell; | |
width:33%; | |
padding:1em; | |
} | |
.bg__green{ | |
background:#bada55; | |
border:1px solid #333; | |
} |
This file contains hidden or 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
<div class="table"> | |
<div class="table--row"> | |
<div class="table--cell bg__green"> | |
We are all equal heights, thanks to display:table; | |
</div> | |
<div class="table--cell bg__green"> | |
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. | |
Nulla vitae elit libero, a pharetra augue. | |
Nulla vitae elit libero, a pharetra augue. | |
Sed posuere consectetur est at lobortis. | |
Maecenas sed diam eget risus varius blandit sit amet non maelit libero, a pharetra augue. Sed posuere consectetur est at lobortis. | |
Maecenas sed diam eget risus varius blandit sit amet non magna. | |
</div> | |
<div class="table--cell bg__green"> | |
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. | |
Nulla vitae elit libero, a pharetra augue. | |
Nulla vitae elit libero, a pharetra augue. | |
Sed posuere consectetur est at lobortis. | |
Maecenas sed diam eget risus varius blandit sit amet non magna. | |
</div> | |
</div> | |
</div> |
This file contains hidden or 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
// alert('Hello world!'); |
This file contains hidden or 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
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment