I am building a site with Google's MDL and wondering how to work with nested grids properly.
Every nesting level shifts a little to the right. That becomes quite odd, when you just want to list some products or have other nested cells.
See http://codepen.io/suntrop/pen/BQPody
<div class="mdl-grid">
<div class="mdl-cell mdl-cell--8-col">
<h1>Page Titel</h1>
<p>Some content</p>
<div class="mdl-grid">
<div class="mdl-cell mdl-cell--6-col">
Product #1
<div class="mdl-grid">
<div class="mdl-cell mdl-cell--6-col">
<img src="http://placehold.it/100" alt="" />
</div>
<div class="mdl-cell mdl-cell--6-col">
Product Description
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>
</div>
</div>
</div>
<div class="mdl-cell mdl-cell--6-col">
Products #2 <br />
…
</div>
</div>
</div>
<div class="mdl-cell mdl-cell--4-col">
<h3>Sidebar</h3>
</div>
</div>
Grids I know (if I'am not wrong :-) stay vertically in a line. So that title, content, product title and its picture are perfectly aligned.
There is a mdl-grid--no-spacing class, but this removes all spacing. Even that under the cell and to the right.
Perhaps I missed something in the MDL concept or I have to code my own "grid class". Perhaps I am doing something other wrong :-)
mdl-grid--no-spacing
to disable spacing, and then add extra class for product cells, withpadding-right
andpadding-bottom
properties? – Georgy