Esta tradução está incompleta. Por favor, ajude a traduzir este artigo.

Esta é uma tecnologia experimental
Verifique a tabela de compatibilidade entre Navegadores cuidadosamente antes de usar essa funcionalidade em produção.

A propriedade CSS block-size define o tamanho horizontal ou vertical de um elemento bloco. Corresponde à propriedade width ou height, dependendo do valor do writing-mode.

 

Sintaxe

/* valores <length> */
block-size: 300px;
block-size: 25em;

/* valores <percentage> */
block-size: 75%;

/* valores de Keyword */
block-size: 25em border-box;
block-size: 75% content-box;
block-size: max-content;
block-size: min-content;
block-size: available;
block-size: fit-content;
block-size: auto;

/* valores globais */
block-size: inherit;
block-size: initial;
block-size: unset;

Se o modo de escrita está orientado verticalmente, o valor do block-size refere-se à largura do elemento; senão, refere-se à altura do elemento. Uma propriedade relacionada é inline-size, que define as outras dimensões do elemento.

Initial valueauto
Aplica-se asame as width and height
Inheritednão
Percentagesblock-size of containing block
Midiavisual
Computed valuesame as width and height
Animation typediscrete
Canonical orderthe unique non-ambiguous order defined by the formal grammar

Sintaxe

Valores

A propriedade block-size leva os mesmos valores que as propriedades width e height.

Sintaxe formal

<'width'>

Exemplo

HTML

<p class="exampleText">Example text</p>

CSS

.exampleText {
  writing-mode: vertical-rl;
  background-color: yellow;
  block-size: 200px;
}

Especificação

Specification Status Comment
CSS Logical Properties and Values Level 1
The definition of 'block-size' in that specification.
Rascunho editorial Definição inicial

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
block-sizeChrome Full support 57Edge No support NoFirefox Full support 41
Full support 41
No support 38 — 51
Disabled
Disabled From version 38 until version 51 (exclusive): this feature is behind the layout.css.vertical-text.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE No support NoOpera Full support 44Safari No support NoWebView Android Full support 57Chrome Android Full support 57Edge Mobile No support NoFirefox Android Full support 41
Full support 41
No support 38 — 51
Disabled
Disabled From version 38 until version 51 (exclusive): this feature is behind the layout.css.vertical-text.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android Full support 44Safari iOS No support NoSamsung Internet Android Full support 5.0
max-contentChrome Full support 57Edge No support NoFirefox Full support 66IE No support NoOpera Full support 44Safari No support NoWebView Android Full support 57Chrome Android Full support 57Edge Mobile No support NoFirefox Android Full support 66Opera Android Full support 44Safari iOS No support NoSamsung Internet Android Full support 5.0
min-contentChrome Full support 57Edge No support NoFirefox Full support 66IE No support NoOpera Full support 44Safari No support NoWebView Android Full support 57Chrome Android Full support 57Edge Mobile No support NoFirefox Android Full support 66Opera Android Full support 44Safari iOS No support NoSamsung Internet Android Full support 5.0
fit-contentChrome Full support 57Edge No support NoFirefox Full support 41
Prefixed
Full support 41
Prefixed
Prefixed Implemented with the vendor prefix: -moz-
IE No support NoOpera Full support 44Safari No support NoWebView Android Full support 57Chrome Android Full support 57Edge Mobile No support NoFirefox Android ? Opera Android Full support 44Safari iOS No support NoSamsung Internet Android Full support 5.0
Alternate Name
Full support 5.0
Alternate Name
Alternate Name Uses the non-standard name: -webkit-fill-available

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
User must explicitly enable this feature.
User must explicitly enable this feature.
Uses a non-standard name.
Uses a non-standard name.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

See also

Etiquetas do documento e colaboradores

Colaboradores desta página: mdnwebdocs-bot, ViniciusMatias
Última atualização por: mdnwebdocs-bot,