📜  CSS |列宽属性

📅  最后修改于: 2021-08-30 12:54:24             🧑  作者: Mango

CSS 中的 columns-width 属性用于定义列的宽度。显示元素中的内容需要最少的列数。这是一个灵活的属性。如果浏览器在给定的列宽下无法容纳至少两列,那么这两列将放入一列。
句法:

column-width: auto|length|initial|inherit; 

属性值:

  • auto:这是默认值。浏览器确定列的宽度。
    句法:
column-width: auto;
  • 例子:
html


    
        
            CSS column-width Property
        
         
        
    
     
    
        

            The column-width Property         

                  
            The course is designed for students as well             as working professionals to prepare for             coding interviews. This course is going             to have coding questions from school level             to the level needed for product based             companies like Amazon, Microsoft, Adobe, etc.         
    


html


    
        
            CSS column-width Property
        
         
        
    
     
    
        

            The column-width Property         

                  
            The course is designed for students as well             as working professionals to prepare for             coding interviews. This course is going             to have coding questions from school level             to the level needed for product based             companies like Amazon, Microsoft, Adobe, etc.         
    


html


    
        
            CSS column-width Property
        
         
        
    
     
    
        

            The column-width Property         

                  
            The course is designed for students as well             as working professionals to prepare for             coding interviews. This course is going             to have coding questions from school level             to the level needed for product based             companies like Amazon, Microsoft, Adobe, etc.         
    


  • 输出:

  • length:用于根据长度指定列的宽度。长度可以设置为px、cm等形式。
    句法:
column-width: length;
  • 例子:

html



    
        
            CSS column-width Property
        
         
        
    
     
    
        

            The column-width Property         

                  
            The course is designed for students as well             as working professionals to prepare for             coding interviews. This course is going             to have coding questions from school level             to the level needed for product based             companies like Amazon, Microsoft, Adobe, etc.         
                                         
  • 输出:

  • initial:用于将 column-width 属性设置为其默认值。
    句法:
column-width: initial;
  • 例子:

html



    
        
            CSS column-width Property
        
         
        
    
     
    
        

            The column-width Property         

                  
            The course is designed for students as well             as working professionals to prepare for             coding interviews. This course is going             to have coding questions from school level             to the level needed for product based             companies like Amazon, Microsoft, Adobe, etc.         
                                      
  • 输出:

  • 继承:用于从其父级设置列宽属性。

支持的浏览器: column-width属性支持的浏览器如下:

  • 谷歌浏览器 50.0、4.0-webkit
  • 浏览器 10.0
  • 火狐 52.0, 2.0-moz-
  • Opera 37.0、15.0-webkit-、11.1
  • Safari 9.0, 3.1-webkit