Skip to content

Instantly share code, notes, and snippets.

@nswyer
Created February 24, 2014 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nswyer/9193844 to your computer and use it in GitHub Desktop.
Save nswyer/9193844 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<ul class="grid">
<li><a href="#">one</a></li>
<li><a href="#">two</a></li>
<li><a href="#">three</a></a></li>
<li><a href="#">four</a></li>
<li><a href="#">five</a></li>
<li><a href="#">six</a></li>
</ul>
// ----
// Sass (v3.3.0.rc.5)
// Compass (v1.0.0.alpha.18)
// ----
.grid{
list-style: none;
text-align: center;
clear: both;
width: 98%;
margin: 0px auto;
border:1px dashed #999;
li{
display: inline-block;
background: #ccc;
width: 10%;
height: 0; /* height 0 with a padding-bottom of the width % creates a responsive box */
padding-bottom: 10%;
margin: 1.5%;
color: #fff;
a{
display:block;
width:100%;
height:100%;
color: #fff;
text-decoration: none;
text-transform: uppercase;
font-size: 10px;
}
}
}
.grid {
list-style: none;
text-align: center;
clear: both;
width: 98%;
margin: 0px auto;
border: 1px dashed #999;
}
.grid li {
display: inline-block;
background: #ccc;
width: 10%;
height: 0;
/* height 0 with a padding-bottom of the width % creates a responsive box */
padding-bottom: 10%;
margin: 1.5%;
color: #fff;
}
.grid li a {
display: block;
width: 100%;
height: 100%;
color: #fff;
text-decoration: none;
text-transform: uppercase;
font-size: 10px;
}
<ul class="grid">
<li><a href="#">one</a></li>
<li><a href="#">two</a></li>
<li><a href="#">three</a></a></li>
<li><a href="#">four</a></li>
<li><a href="#">five</a></li>
<li><a href="#">six</a></li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment