Twitter Bootstrap - add top space between rows

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

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

相关标签:
19条回答
  • 2020-11-28 18:04

    Sometimes margin-top can causes design problems:

    http://www.w3.org/TR/CSS2/box.html#collapsing-margins

    So, i recommend create "margin-bottom classes" instead of "margin-top classes" and apply them to the previous item.

    If you are using Bootstrap importing LESS Bootstrap files try to define the margin-bottom classes with proportional Bootstrap Theme spaces:

    .margin-bottom-xs {margin-bottom: ceil(@line-height-computed / 4);}  
    .margin-bottom-sm {margin-bottom: ceil(@line-height-computed / 2);} 
    .margin-bottom-md {margin-bottom: @line-height-computed;}
    .margin-bottom-lg {margin-bottom: ceil(@line-height-computed * 2);}  
    
    0 讨论(0)
提交回复
热议问题