Stijl alignZelfeigenschap _
Voorbeeld
Stel de uitlijning in voor een van de items in een flexibel element om in de container te passen:
document.getElementById("myBlueDiv").style.alignSelf = "stretch";
Definitie en gebruik
De eigenschap alignSelf specificeert de uitlijning voor het geselecteerde item in de flexibele container.
Opmerking: De eigenschap alignSelf overschrijft de eigenschap alignItems van de flexibele container.
Browserondersteuning
De getallen in de tabel geven de eerste browserversie aan die de eigenschap volledig ondersteunt.
Nummers gevolgd door Webkit geven de eerste versie aan die met een voorvoegsel werkte.
Property | |||||
---|---|---|---|---|---|
alignSelf | 21.0 | 11.0 | 20.0 | 9.0 7.0 Webkit |
12.1 |
Syntaxis
Retourneer de eigenschap alignSelf:
object.style.alignSelf
Stel de eigenschap alignSelf in:
object.style.alignSelf = "auto|stretch|center|flex-start|flex-end|baseline|initial|inherit"
Eigendomswaarden
Value | Description |
---|---|
auto | Default. The element inherits its parent container's align-items property, or "stretch" if it has no parent container |
stretch | The element is positioned to fit the conatiner |
center | The element is positioned at the center of the container |
flex-start | The element is are positioned at the beginning of the container |
flex-end | The element is positioned at the end of the container |
baseline | The element is positioned at the baseline of the container |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Technische details
Standaardwaarde: | auto |
---|---|
Winstwaarde: | Een String, die de eigenschap align-self van een element vertegenwoordigt |
CSS-versie | CSS3 |
Gerelateerde pagina's
CSS-referentie: eigenschap align-self
HTML DOM STYLE Referentie: alignContent eigenschap
HTML DOM STYLE Referentie: eigenschap alignItems