min-height
Sumário
A propriedade min-height
do CSS é usado para definir a altura mínima de um determinado elemento. Ele impede que o valor usado da propriedade height
se torne menor que o valor especificado para min-height.
O valor de min-height
substitui os dois max-height
(en-US) e height
.
Initial value | auto |
---|---|
Aplica-se a | all elements but non-replaced inline elements, table columns, and column groups |
Inherited | não |
Percentages | The percentage is calculated with respect to the height of the generated box's containing block. If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as 0 . |
Computed value | the percentage as specified or the absolute length |
Animation type | a length, percentage or calc(); |
Sintaxe
sintaxe forma:min-height =
auto |
<length-percentage [0,∞]> (en-US) |
min-content |
max-content |
fit-content( <length-percentage [0,∞]> (en-US) )
<length-percentage> =
<length> (en-US) |
<percentage> (en-US)
min-height: 3.5em min-height: 10% min-height: max-content min-height: min-content min-height: fit-content min-height: fill-available min-height: inherit
Valores
<length>
-
O valor fixo mínimo da altura. Veja
<length>
(en-US) para possíveis unidades. Valores negativos fazem da declaração inválida. <percentage>
-
O valor fixo mínimo da altura expressado como uma
<percentage>
(en-US) do conteúdo da altura do bloco. Valores negativos fazem da declaração inválida. max-content
Experimental-
The intrinsic preferred height.
min-content
Experimental-
The intrinsic minimum height.
fill-available
Experimental-
The containing block height minus horizontal margin, border and padding. Some browsers implement an ancient name for this keyword,
available
. fit-content
Experimental-
According CSS3 Box, this is a synonym of
min-content
. CSS3 Sizing defines a more complex algorithm, but no browser implements it, even in an experimental way.
Exemplos
css
table { min-height: 75%; }
form { min-height: 0; }
Especificações
Especificação | Status | Comentário |
---|---|---|
CSS Box Sizing Module Level 3 The definition of 'min-height' in that specification. |
Rascunho atual | Adds the max-content , min-content , fit-content , and fill-available keywords. Both CSS3 Box and CSS3 Writing Modes drafts defined at some point these keywords. These drafts are superseded by this spec. |
CSS Flexible Box Layout Module The definition of 'min-height' in that specification. |
Candidata a Recomendação | An earlier revision of the spec added the auto keyword and used it as the initial value. The CSSWG subsequently resolved to revert this change, however. As of March 29, 2013, the latest Editor's Draft doesn't modify the min-width property anymore (i.e. it no longer introduces the auto value). |
CSS Transitions The definition of 'min-height' in that specification. |
Rascunho atual | Defines min-height as animatable. |
CSS Level 2 (Revision 1) The definition of 'min-height' in that specification. |
Recomendação | Initial definition. |
Navegadores compatíveis
BCD tables only load in the browser