📜  CSS | min-height 属性

📅  最后修改于: 2021-09-02 03:14:30             🧑  作者: Mango

CSS 中的 min-height 属性用于设置元素的最小高度。当元素的内容小于 min-height 时使用 min-height 属性,如果内容大于 min-height 则它不起作用。此属性确保 height 属性的值不小于所考虑元素的指定 min-height 值。

句法:

min-height: length|initial|inherit; 

适当的价值:

  • length:此属性用于设置最小高度。长度的默认值为0。高度可以设置为px、%、cm等形式。

    句法:

    min-height: length;

    例子:

    
    
        
            
                min-height property
            
              
            
        
        
            

                Prepare for the Recruitment drive of product             based companies like Microsoft, Amazon, Adobe             etc with a free online placement preparation             course. The course focuses on various MCQ's              & Coding question likely to be asked in the             interviews & make your upcoming placement              season efficient and successful.         

                             

    输出:
    最小高度

  • initial:用于将 min-height 属性的值设置为其默认值。

    句法:

    min-height: initial;

    例子:

    
    
        
            
                min-height property
            
              
            
        
        
            

                Prepare for the Recruitment drive of product             based companies like Microsoft, Amazon, Adobe             etc with a free online placement preparation             course. The course focuses on various MCQ's              & Coding question likely to be asked in the             interviews & make your upcoming placement              season efficient and successful.         

                             

    输出:
    最小高度

  • 继承:此属性是从其父级继承的。

支持的浏览器: min-height属性支持的浏览器如下:

  • 谷歌浏览器 1.0
  • 浏览器 7.0
  • 火狐 3.0
  • Safari 2.0.2
  • 歌剧4.0