Vlastnost Styl alignSelf
Příklad
Nastavte zarovnání pro jednu z položek uvnitř flexibilního prvku tak, aby odpovídala kontejneru:
document.getElementById("myBlueDiv").style.alignSelf = "stretch";
Definice a použití
Vlastnost alignSelf určuje zarovnání pro vybranou položku uvnitř flexibilního kontejneru.
Poznámka: Vlastnost alignSelf přepíše vlastnost alignItems flexibilního kontejneru.
Podpora prohlížeče
Čísla v tabulce určují první verzi prohlížeče, která plně podporuje vlastnost.
Čísla následovaná Webkitem určují první verzi, která pracovala s předponou.
Property | |||||
---|---|---|---|---|---|
alignSelf | 21.0 | 11.0 | 20.0 | 9.0 7.0 Webkit |
12.1 |
Syntax
Vraťte vlastnost alignSelf:
object.style.alignSelf
Nastavte vlastnost alignSelf:
object.style.alignSelf = "auto|stretch|center|flex-start|flex-end|baseline|initial|inherit"
Hodnoty vlastností
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 |
Technické údaje
Výchozí hodnota: | auto |
---|---|
Návratová hodnota: | Řetězec představující vlastnost align-self prvku |
Verze CSS | CSS3 |
Související stránky
CSS reference: vlastnost align-self
Odkaz na STYL DOM HTML: vlastnost alignContent
Odkaz na STYL DOM HTML: vlastnost alignItems