CSSalign -contentプロパティ
例
フレックスコンテナの中心に向かってラインをパックします。
div
{
width: 70px;
height: 300px;
border: 1px solid #c3c3c3;
display: flex;
flex-wrap: wrap;
align-content: center;
}
定義と使用法
このプロパティは、 flex-wrapalign-content
プロパティの動作を変更し
ます。これはalign-itemsに似てい
ますが、フレックスアイテムを整列させる代わりに、フレックスラインを整列させます。
注:このプロパティを有効にするには、複数のアイテム行が必要です。
ヒント:justify-contentプロパティを使用して、アイテムを主軸に(水平方向に)配置します。
デフォルト値: | ストレッチ |
---|---|
遺伝性の: | いいえ |
アニメート可能: | 番号。アニメート可能について読む |
バージョン: | CSS3 |
JavaScript構文: | object .style.alignContent = "center" |
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
数字の後に-webkit-が続く場合は、プレフィックスを使用して機能した最初のバージョンを指定します。
Property | |||||
---|---|---|---|---|---|
align-content | 21.0 | 11.0 | 28.0 | 9.0 7.0 -webkit- |
12.1 |
CSS構文
align-content: stretch|center|flex-start|flex-end|space-between|space-around|initial|inherit;
プロパティ値
Value | Description | Play it |
---|---|---|
stretch | Default value. Lines stretch to take up the remaining space | |
center | Lines are packed toward the center of the flex container | |
flex-start | Lines are packed toward the start of the flex container | |
flex-end | Lines are packed toward the end of the flex container | |
space-between | Lines are evenly distributed in the flex container | |
space-around | Lines are evenly distributed in the flex container, with half-size spaces on either end | |
space-evenly | Lines are evenly distributed in the flex container, with equal space around them | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
関連ページ
CSSリファレンス:align-itemsプロパティ
CSSリファレンス:align-selfプロパティ
CSSリファレンス:justify-contentプロパティ
HTML DOMリファレンス:alignContentプロパティ