max-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 enero de 2020.
* Some parts of this feature may have varying levels of support.
Experimental: Esta es una tecnología experimental
Comprueba la Tabla de compabilidad de navegadores cuidadosamente antes de usarla en producción.
La propiedad de CSS max-inline-size define el tamaño máximo horizontal o vertical de un elemento bloque dependiendo del modo de escritura. Esto corresponde a las propiedades max-width o max-height dependiendo de los valores definidos por writing-mode. Si el modo de escritura esta orientado verticalmente, el valor de max-inline-size relacionado al alto máximo del elemento, de lo contrario, se relaciona con el ancho máximo del elemento. Se relaciona con max-block-size, que define la otra dimensión del elemento.
Pruébalo
max-inline-size: 150px;
writing-mode: horizontal-tb;
max-inline-size: 150px;
writing-mode: vertical-rl;
max-inline-size: 20px;
writing-mode: horizontal-tb;
max-inline-size: 75%;
writing-mode: vertical-lr;
<section class="default-example" id="default-example">
<div class="transition-all" id="example-element">
This is a box where you can change the max-inline-size.
</div>
</section>
#example-element {
display: flex;
flex-direction: column;
background-color: #5b6dcd;
height: 80%;
justify-content: center;
color: #ffffff;
}
Sintaxis
/* <length> values */
max-inline-size: 300px;
max-inline-size: 25em;
/* <percentage> values */
max-inline-size: 75%;
/* Keyword values */
max-inline-size: none;
max-inline-size: max-content;
max-inline-size: min-content;
max-inline-size: fit-content;
max-inline-size: fill-available;
/* Global values */
max-inline-size: inherit;
max-inline-size: initial;
max-inline-size: unset;
| Valor inicial | none |
|---|---|
| Applies to | same as width and height |
| Heredable | no |
| Percentages | inline-size of containing block |
| Valor calculado | same as max-width and max-height |
| Animation type | a length, percentage or calc(); |
Valores
La propiedad max-inline-size toma los mismos valores como las propiedades max-width y max-height.
Sintaxis formal
max-inline-size =
none |
<box-size>
<box-size> =
<length-percentage> |
stretch |
contain |
min-content |
max-content |
fit-content |
fit-content( ) |
calc-size( )
<length-percentage> =
<length> |
<percentage>
Ejemplo
>Contenido HTML
<p class="exampleText">Example text</p>
Contenido CSS
.exampleText {
writing-mode: vertical-rl;
background-color: yellow;
block-size: 100%;
max-inline-size: 200px;
}
Especificaciones
| Specification |
|---|
| CSS Logical Properties and Values Module Level 1> # propdef-max-inline-size> |
| CSS Box Sizing Module Level 3> # sizing-values> |
Compatibilidad con navegadores
Mira también
- Las propiedades físicas mapeadas:
max-widthymax-height writing-mode