inline-size
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. It’s been available across browsers since janeiro de 2020.
* Some parts of this feature may have varying levels of support.
Experimental: Esta é uma tecnologia experimental
Verifique a tabela de compatibilidade entre Navegadores cuidadosamente antes de usar essa funcionalidade em produção.
A propriedade do CSS inline-size define o tamanho horizontal e vertical de um elemento bloco. Ele é correspondente a cada propriedade width ou a height, dependendo do valor de writing-mode.
/* <length> values */
inline-size: 300px;
inline-size: 25em;
/* <percentage> values */
inline-size: 75%;
/* Keyword values */
inline-size: 25em border-box;
inline-size: 75% content-box;
inline-size: max-content;
inline-size: min-content;
inline-size: available;
inline-size: fit-content;
inline-size: auto;
/* Global values */
inline-size: inherit;
inline-size: initial;
inline-size: unset;
Se o writing mode é orientado verticalmente, o valor de inline-size relaciona a altura do elemento; ao contrário, está relacionado a largura do elemento. A propriedade relacionada é a block-size, no qual define a outra dimensão do elemento.
| Initial value | auto |
|---|---|
| Aplica-se a | same as width and height |
| Inherited | não |
| Percentages | inline-size of containing block |
| Computed value | same as width and height |
| Animation type | a length, percentage or calc(); |
Sintaxe
>Valores
A propriedade inline-size aproveita os mesmos valores que as propriedades width e height.
Sintaxe formal
inline-size =
auto |
<box-size>
<box-size> =
<length-percentage> |
stretch |
contain |
min-content |
max-content |
fit-content |
fit-content( ) |
calc-size( )
<length-percentage> =
<length> |
<percentage>
Exemplo
>HTML
<p class="exampleText">Texto de Exemplo</p>
CSS
.exampleText {
writing-mode: vertical-rl;
background-color: yellow;
inline-size: 110px;
}
Especificações
| Specification |
|---|
| CSS Logical Properties and Values Module Level 1> # dimension-properties> |
| CSS Box Sizing Module Level 3> # sizing-values> |
Compatibilidade com navegadores
Veja também
- As propriedades físicas mapeadas:
widtheheight writing-mode