Свойство CSS align-self
Пример
Отцентрируйте выравнивание для одного из элементов внутри гибкого элемента:
#myBlueDiv
{
align-self: center;
}
Определение и использование
Свойство align-self
указывает выравнивание для выбранного элемента внутри гибкого контейнера.
Примечание. Это свойство переопределяет свойство align-itemsalign-self
гибкого контейнера
.
Значение по умолчанию: | авто |
---|---|
Унаследовано: | нет |
Анимация: | нет. Читать об анимации |
Версия: | CSS3 |
Синтаксис JavaScript: | объект .style.alignSelf="центр" |
Поддержка браузера
Цифры в таблице указывают на первую версию браузера, которая полностью поддерживает это свойство.
Цифры, за которыми следует -webkit-, указывают на первую версию, которая работала с префиксом.
Property | |||||
---|---|---|---|---|---|
align-self | 21.0 | 11.0 | 20.0 | 9.0 7.0 -webkit- |
12.1 |
Синтаксис CSS
align-self: auto|stretch|center|flex-start|flex-end|baseline|initial|inherit;
Значения свойств
Value | Description | Play it |
---|---|---|
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 container | |
center | The element is positioned at the center of the container | |
flex-start | The element is 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 |
Связанные страницы
Справочник по CSS: свойство align-content
Справочник по CSS: свойство align-items
Справочник по HTML DOM: свойство alignSelf