A Pen by Max Dolgov on CodePen.
Last active
May 15, 2017 11:15
-
-
Save plugn/6716886 to your computer and use it in GitHub Desktop.
justify grid css
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="fluegrid look"> | |
<div style="width:40%">flexible</div> | |
<div style="width:20%">grid</div> | |
<div style="25%">css</div> | |
<div style="15%">hack</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
/* normalize */ | |
*, *:before, *:after { | |
-webkit-box-sizing: border-box; | |
-moz-box-sizing: border-box; | |
box-sizing: border-box; | |
position: relative; | |
} | |
.fluegrid { | |
width: 100%; | |
text-align: justify; | |
clear: both; | |
font-size: 0; | |
font-size: 12px\9; /* IE6-9 only hack */ | |
} | |
.fluegrid > div{ | |
display: inline-block; | |
font-size: 12px; | |
zoom: 1; | |
*display: inline; | |
} | |
.fluegrid:after{ | |
content: ""; | |
width: 100%; | |
display: inline-block; | |
zoom: 1; | |
*display: inline; | |
} | |
.look { | |
width: 100%; | |
margin: 10px 0 0 0; | |
background: #ccc; | |
padding: 5px' | |
} | |
.look div { | |
background: white; | |
font-size: 12px; | |
} | |
/*****************************/ | |
/* Only to see effect better */ | |
.fluegrid div { | |
outline: 1px dashed #888; | |
padding: 5px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment