Bootstrap row class contains margin-left and margin-right which creates problems

前端 未结 8 1991
北恋
北恋 2020-12-02 15:20

I am using Bootstrap \'row\' class to align divs one on top of another, which works fine but

.row {
   margin-left: -15px;
   marg         


        
相关标签:
8条回答
  • 2020-12-02 16:06

    Old topic, but I was recently affected by this.

    Using a class "row-fluid" instead of "row" worked fine for me but I'm not sure if it's fully supported going forward.

    So after reading Why does the bootstrap .row has a default margin-left of -30px I just used the <div> (without any row class) and it behaved exactly like <div class="row-fluid">

    0 讨论(0)
  • 2020-12-02 16:08

    Here is your simple and easy answer

    Go to your class where you want to give a negative margin then copy and paste this inside the class.

    Example for negative margin top

    mt-n3
    

    Example for negative margin bottom

    mb-n2
    
    0 讨论(0)
提交回复
热议问题