Skip to content

Instantly share code, notes, and snippets.

@keeprock
Created March 10, 2015 07:39
Show Gist options
  • Save keeprock/ac7dfd2bbc9fd23d0cb6 to your computer and use it in GitHub Desktop.
Save keeprock/ac7dfd2bbc9fd23d0cb6 to your computer and use it in GitHub Desktop.
Justify text with UL and LI elements using "text-align: justify" property http://www.barrelny.com/blog/text-align-justify-and-rwd/
<ul id="Grid">
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
#Grid {
text-align: justify;
font-size: 0.1px; /*hide whitespace between elements*/
}
#Grid li{
display: inline-block;
width: 23%;
}
#Grid:after{
content: '';
display: inline-block;
width: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment