简体   繁体   中英

Susy Grid not getting Grid Padding

I am trying to add another grid inside my main grid on an element of .fat . My code is:

footer
  .fat
    $container-width: 100%
    +with-grid-settings($columns: 8, $padding: 10px)
      +susy-grid-background

It's all working however, there is no 10px of padding on the left and right of the grid.

Any ideas?

In this case you'll have to add the actual padding yourself. Since grid backgrounds are fluid ( % -based) and grid-padding can use any units, the grid-padding is not factored into the background image. Instead, we use background-origin and background-clip to confine the image inside the content box.

Also, in this case, since you are not actually setting the width anywhere, you don't need a $container-width setting. Here's what you need:

footer
  .fat
    +with-grid-settings($columns: 8, $padding: 10px)
      +susy-grid-background
      padding: 0 $grid-padding

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM