Propiedad de estilo de justificar el contenido
Ejemplo
Haz algo de espacio entre los elementos del elemento <div> flexible:
document.getElementById("main").style.justifyContent = "space-between";
Definición y uso
La propiedad allowContent alinea los elementos del contenedor flexible cuando los elementos no utilizan todo el espacio disponible en el eje principal (horizontalmente).
Sugerencia: use la propiedad alignContent para alinear los elementos en el eje transversal (verticalmente).
Compatibilidad con navegador
Property | |||||
---|---|---|---|---|---|
justifyContent | Yes | 12.0 | Yes | 9.0 | Yes |
Sintaxis
Devuelve la propiedad justificarContenido:
object.style.justifyContent
Establezca la propiedad allowContent:
object.style.justifyContent = "flex-start|flex-end|center|space-between|space-around|initial|inherit"
Valores de propiedad
Value | Description |
---|---|
flex-start | Default value. Items are positioned at the beginning of the container |
flex-end | Items are positioned at the end of the container |
center | Items are positioned at the center of the container |
space-between | Items are positioned with space between the lines |
space-around | Items are positioned with space before, between, and after the lines |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Detalles técnicos
Valor por defecto: | arranque flexible |
---|---|
Valor de retorno: | Una cadena, que representa la propiedad de contenido justificado de un elemento |
Versión CSS | CSS3 |
páginas relacionadas
Referencia de CSS: propiedad de contenido de justificación
Referencia HTML DOM STYLE: propiedad alignContent
Referencia HTML DOM STYLE: propiedad alignItems
Referencia HTML DOM STYLE: propiedad alignSelf
❮ Objeto de estilo