justify-self
沿着 行轴线(row axis) 对齐 网格项 内的内容( 相反的属性是 align-self ,沿着列轴线(column axis)对齐)。此值适用于单个网格项内的内容。
- start:将内容对齐到网格区域的左侧
- end:将内容对齐到网格区域的右侧
- center:将内容对齐到网格区域的中间(水平居中)
- stretch:填充整个网格区域的宽度(这是默认值)
.item-a {
justify-self: start;
}
.item-a {
justify-self: end;
}
.item-a {
justify-self: center;
}
.item-a {
justify-self: stretch;
}
要为网格中的所有网格项设置 行轴线(row axis) 线上对齐方式,也可以在 网格容器 上设置 justify-items 属性。