display |
表示形式を変更 |
display:flex;
/* 格子状に並べる */
display:grid;
|
flex-direction |
Flexの並ぶ方向 |
flex-direction:column;
/* 横並びにする */
flex-direction:row;
|
justify-content |
主軸方向の配置 |
justify-content:space-between;
/* 中央に配置 */
justify-content:center;
|
align-items |
交差軸方向の配置 |
align-items:center;
/* 上揃えにする */
align-items:flex-start;
|
gap |
要素同士の間隔 |
gap:12px;
/* 行と列で分けて指定 */
gap:12px 20px;
|
flex-wrap |
折り返すかどうか |
flex-wrap:wrap;
/* 一列を維持 */
flex-wrap:nowrap;
|
flex |
Flex項目の伸縮 |
flex:1;
/* 伸縮と基本幅を指定 */
flex:1 1 240px;
|
grid-template-columns |
Gridの列指定 |
grid-template-columns:repeat(2,1fr);
/* 自動で列数を調整 */
grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
|
grid-column |
列の占有範囲 |
grid-column:span 2;
/* 全列をまたぐ */
grid-column:1/-1;
|
position |
配置方法 |
position:sticky;
/* 画面下に固定 */
position:fixed;
|
top |
上からの位置 |
top:0;
/* 固定したヘッダー */
top:12px;
|
bottom |
下からの位置 |
bottom:0;
/* 下部固定メニュー */
bottom:env(safe-area-inset-bottom);
|
z-index |
重なり順 |
z-index:100;
/* メニューを前面へ */
z-index:999;
|
inset |
上下左右をまとめて指定 |
inset:0;
/* 上下左右に余白 */
inset:12px;
|
transform |
移動・回転・拡大縮小 |
transform:translateY(-4px);
/* 少し拡大 */
transform:scale(1.05);
|