📌  相关文章
📜  如何在Bootstrap中删除特定div的装订线空间?

📅  最后修改于: 2021-05-25 17:09:19             🧑  作者: Mango

要删除特定div的装订线空间,首先我们必须知道什么是装订线空间。在Bootstrap 4中,网格系统中有12列,每列之间有一个很小的空间,该空间称为装订线空间。装订线空间的宽度为30像素(一列的每侧15像素)。以下方法将清楚地说明。

方法:

  • 默认情况下,Bootstrap 4具有class =“ no-gutters”来删除任何特定div的装订线空间。下图显示了突出显示的装订线空间和引导程序4 12列网格系统上的列之间的空间。您甚至可以通过减少每列之间的装订线间距的15px宽度来修改装订线宽度。

示例1:下面的示例说明如何删除特定div的装订线空间。



  

    
    
    
    
    
    

  

    
        
            

              GeeksforGeeeks             

            
            
                

With Gutter space

            
            
                
                    .col-12 .col-sm-6 .col-md-8                 
                
                    .col-6 .col-md-4                 
            
               
                

Without Gutter space

            
            
                
                    .col-12 .col-sm-6 .col-md-8                 
                
                    .col-6 .col-md-4                 
            
        
    
  

输出:

示例2:下面的示例说明如何仅删除特定div的装订线空间。



  

    
    
    
    
    
    

  

    
        
            

              GeeksforGeeeks             

            
               
                               
                    
                        .col-6 .col-sm-3                     
                    
                        .col-6 .col-sm-3                     
                    Without Gutter space                 
                                   
                    
                        .col-6 .col-sm-3                      
                    
                        .col-6 .col-sm-3                      
                    With Gutter space                 
                                   
                    
                        .col-4 .col-sm-2                      
                    
                        .col-4 .col-sm-2                      
                    
                        .col-4 .col-sm-2                     
                    Without Gutter space                 
                                   
                    
                        .col-4 .col-sm-2                      
                    
                        .col-4 .col-sm-2                      
                    
                        .col-4 .col-sm-2                     
                    With Gutter space                 
            
        
    
  

输出:

参考: https://getbootstrap.com/docs/4.3/layout/grid/#no-gutters