Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would like to see example code for nested grids with good gutter control #50

Open
moonbeetle opened this issue Dec 5, 2013 · 2 comments

Comments

@moonbeetle
Copy link

If I nest a grid I always get double the margin-left or padding-left.

@scottmontminy
Copy link

Make sure your .grid__item elements are always children of a .grid, even when you're nesting.

Also, because this framework uses inline-block for laying out .grid__items, you have to comment out whitespace between .grid__items otherwise the inherent whitespace between inline-block elements will create unwanted gutter space inbetween.

This page has some nesting examples: http://csswizardry.com/csswizardry-grids/. Check out the source for Grid 2.1 - Grid 2.5.

Here's a simple example:

<div class="grid">
    <div class="grid__item  one-half">
        <div class="grid">
            <div class="grid__item  one-third"></div><!--
         --><div class="grid__item  one-third"></div><!--
         --><div class="grid__item  one-third"></div>
        </div>
    </div><!--
 --><div class="grid__item  one-half">
        <div class="grid">
            <div class="grid__item  one-third"></div><!--
         --><div class="grid__item  one-third"></div><!--
         --><div class="grid__item  one-third"></div>
        </div>
    </div>
</div>

@nicbou
Copy link

nicbou commented Sep 7, 2014

I am here because I was not able to find any relevant examples either. Perhaps it would make sense to include this right in the readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants