Skip to content

Instantly share code, notes, and snippets.

@ebinnion
Last active December 29, 2015 03:59
Show Gist options
  • Save ebinnion/7611737 to your computer and use it in GitHub Desktop.
Save ebinnion/7611737 to your computer and use it in GitHub Desktop.
.equiwidth {
text-align: justify;
line-height: .5em;
padding-top: .25em;
line-height: 0;
* {
display: inline;
}
li {
display: inline-block !important;
width: auto!important;
a {
margin: 0;
line-height: 1em;
}
}
&:after {
content: '';
width: 100%; /* Ensures there are at least 2 lines of text, so justification works */
display: inline-block;
}
}
<div class="equiwidth">
<ul>
<!-- There needs to be white space after the li's for this to work. -->
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
<li><a href="#">Link 4</a></li>
</ul>
</div>
.equiwidth {
text-align: justify;
line-height: .5em;
padding-top: .25em;
line-height: 0;
}
.equiwidth * {
display: inline;
}
.equiwidth li {
display: inline-block !important;
width: auto!important;
}
.equiwidth li a {
margin: 0;
line-height: 1em;
}
.equiwidth:after {
content: '';
width: 100%;
/* Ensures there are at least 2 lines of text, so justification works */
display: inline-block;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment