2017-02-16 3 views
0

ネストしたオフセット列を含む2つの列からマージンを削除するにはどうすればよいですか?私は、列内のコンテンツが常に中央に置かれていることを確認したいのですが、@include row (table);ミックスインを使用してこれを動作させることはできません。Bourbon Neatでマージンネストされた列を削除する

codepen

HTML

<section> 
    <div class="container"> 
    <div class="col"> 
     <div class="inner"> 
     centered content 
     </div> 
    </div> 
    <div class="col"> 
     <div class="inner"> 
     centered content 
     </div> 
    </div> 
    </div> 
</section> 

SCSS

@import "bourbon"; 
@import "neat"; 

section{ 
    @include outer-container(100%); 

    .container{ 
     @include span-columns(12); 
     @include fill-parent; 

    .col{ 
     @include span-columns(6); 
     border: 2px solid black; 

     .inner{ 
     @include shift-in-context(1 of 6); 
     @include span-columns(8 of 12); 
      background: red; 

     } 
    } 
    } 
} 

答えて

1

ニートに内蔵されたオプションがあります。ミックスインはreset-display()です。 .innerクラスのブロックごとにテーブルからリセットしてください。あなたはいい形になっていると思います。

section { 
    @include outer-container(100%); 

    .container { 
    @include row(table); 
    @include fill-parent; 

    .col { 
     @include span-columns(6); 
     border: 2px solid black; 

     .inner { 
     @include reset-display; 
     @include shift-in-context(1 of 6); 
     @include span-columns(8 of 12); 
     background: red; 
     } 
    } 
    } 
} 
1

あなたはthisギャップを意味ですか?

CSS

.col{ 
    @include span-columns(6); 
    border: 2px solid black; 
    margin-right: 0; 
    width: 50%; 
+0

100%のコンテナ幅を維持しながら、コル(元のペン)の隙間を取り除きたいと思います。 – Simon

+0

私の編集した答えを見てください。 – Cyto

関連する問題