Twitter Bootstrap - add top space between rows

前端 未结 19 2419
孤独总比滥情好
孤独总比滥情好 2020-11-28 17:17

How to add margin top to class=\"row\" elements using twitter bootstrap framework?

19条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-28 18:03

    Bootstrap 4 alpha, for margin-top: shorthand CSS class names mt-1, mt-2 ( mt-lg-5, mt-sm-2) same for the bottom, right, left, and you have also auto class ml-auto

        

    Units are from 1 to 5 : in the variables.scss which means if you set mt-1 it gives .25rem of margin top.

    $spacers: (
      0: (
        x: 0,
        y: 0
      ),
      1: (
        x: ($spacer-x * .25),
        y: ($spacer-y * .25)
      ),
      2: (
        x: ($spacer-x * .5),
        y: ($spacer-y * .5)
      ),
      3: (
        x: $spacer-x,
        y: $spacer-y
      ),
      4: (
        x: ($spacer-x * 1.5),
        y: ($spacer-y * 1.5)
      ),
      5: (
        x: ($spacer-x * 3),
        y: ($spacer-y * 3)
      )
    ) !default;
    

    read-more here

    https://v4-alpha.getbootstrap.com/utilities/spacing/#horizontal-centering

提交回复
热议问题