I am trying out zen-grids for a website re-design. I like its general ability to produce a grid based, responsive design without putting everything into extra <div>s and adding layout related class names to the tags. I use SASS/Compass anyways, so zen-grids is an obvious choice. But I have a hard time to figure out how to best achieve the following “floating list items” effect (e.g. for a typical product grid in a web store):
<html>
<head>
<style>
ul {
width:100%;
list-style-type:none;
margin:0;
padding:0;
}
li {
width:25%;
height:10em;
background-color: silver;
float:left;
}
</style>
</head>
<body>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
</ul>
</body>
</html>
Say I have a 12 column layout ($zen-column-count: 12;), how could I use zen-grids to put four list items covering three grid columns each next to each other into one row? The only possibility I see myself is to use four different CSS :nth-child pseudo classes and @include zen-grid-item(3, [start column here]);. This rules out all Internet Explorer versions below 9, lacking implementation of that pseudo class.
Does anybody know how to do this?
Salsa magic
I solved the problem by changing the tools: Tsachi Shlidor‘s Salsa is an alternative grid layout system for Sass, which makes the following solution without
:nth-child()possible. I added a littlerespond-toresponsiveness as well.style.scss (compile with compass)
index.html