Вопрос

I've got this weird problem in Zurb Foundation 5. Whenever i nest row inside rows, it produces negative margin, throwing it out of a grid. Here's example markup of my code:

<div class="row main-content">
    <div class="row">
        <div class="breadcrumbs columns small-12">My account / Companies list /</div>
        <div class="columns small-6 heading-container">
            <h1>Create new company</h1>
        </div>
    </div>
</div>

And this is the code, that foundation produces:

.row .row {
    width: auto;
    margin-left: -0.9375rem;
    margin-right: -0.9375rem;
    margin-top: 0;
    margin-bottom: 0;
    max-width: none;
}

How do i prevent this behaviour? Is there something wrong with my markup, or should i override the foundation scss (but i don't want to override default styles).

Это было полезно?

Решение

You need to nest inside a row i.e.

<div class="row">
  <div class="breadcrumbs small-12 columns">
     My account / Companies list /
    <div class="row">
    <div class="Heading-container small-6 columns">
      <h1>Create new company</h1>
    </div>
   </div> <!--/nested row-->
 </div>
</div><!--/row-->

Другие советы

The problem is with "columns" vs "column"

If you add the columns (with an "s") class, it will remove padding since it's the first-child. Change it to the singular "column" and the padding will be added.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top