padding-inline

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 padding-inline define el relleno en línea lógico de inicio y final de un elemento, que asigna las propiedades de relleno físicas dependiendo del modo de escritura del elemento, direccionalidad, y orientación del texto.

css
/* <length> values */
padding-inline: 10px 20px; /* An absolute length */
padding-inline: 1em 2em; /* relative to the text size */
padding-inline: 5% 2%; /* relative to the nearest block container's width */
padding-inline: 10px; /* sets both start and end values */

/* Keyword values */
padding-inline: auto;

/* Global values */
padding-inline: inherit;
padding-inline: initial;
padding-inline: unset;

Estos valores corresponden a las propiedadespadding-top y padding-bottom, o padding-right (en-US), y padding-left (en-US) dependiendo de los valores definidos writing-mode, direction, y text-orientation.

Los valores pueden ser establecidos individualmente como padding-inline-start y padding-inline-end. La propiedad de la dirección bloque es padding-block que establece padding-block-start, y padding-block-end.

Valor inicialas each of the properties of the shorthand:
Applies toall elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column
Heredableno
Percentageslogical-width of containing block
Valor calculadoas each of the properties of the shorthand:
Animation typea length

Sintaxis

Valores

La propiedad padding-inline toma los mismos valores de la propiedad padding-left (en-US).

Sintaxis formal

padding-inline = 
<'padding-top'>{1,2}

Ejemplo

Contenido HTML

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

Contenido CSS

css
div {
  background-color: yellow;
  width: 120px;
  height: 120px;
}

.exampleText {
  writing-mode: vertical-rl;
  padding-inline: 20px 40px;
  background-color: #c8c800;
}

Especificaciones

Specification
CSS Logical Properties and Values Level 1
# propdef-padding-inline

Compatibilidad con navegadores

BCD tables only load in the browser

Mira también