地方自我 | place-self
place-self
place-self
属性同时设置justify-self
属性和align-self
属性。第一个值是justify-self
属性值,第二个是align-self
属性值。如果第二个值不存在,第一个值也用于它。
句法
/* Keyword values */
place-self: auto center;
place-self: normal start;
/* Positional alignment */
place-self: center normal;
place-self: start auto;
place-self: end normal;
place-self: self-start auto;
place-self: self-end normal;
place-self: flex-start auto;
place-self: flex-end normal;
place-self: left auto;
place-self: right normal;
/* Baseline alignment */
place-self: baseline normal;
place-self: first baseline auto;
place-self: last baseline normal;
place-self: stretch auto;
/* Global values */
place-self: inherit;
place-self: initial;
place-self: unset;
值
auto
计算父级的align-items
值。normal
这个关键字的效果取决于我们所在的布局模式:
- 在绝对定位的布局中,关键字的行为类似于
start
上取代
绝对定位的盒子stretch
上所有其他
绝对定位的箱子。
- 在绝对定位布局的静态位置中,关键字表现为
stretch
...
- 对于Flex项,关键字表现为
stretch
...
- 对于网格项,此关键字将导致类似于
stretch
,但具有高宽比或内部大小的盒子除外,在其中会表现为start
.
- 该属性不适用于块级别框和表格单元格。
self-start
将对齐的项目与横轴上对应项目起点的对齐容器的边缘对齐。
first baseline
last baseline
指定参与首次或最后一次基线对齐:将框的第一个或最后一个基准集的对齐基线与基准线共享组中所有框的共享第一个或最后一个基准线集中的相应基线对齐。
回退定位first baseline
是start
,一只为last baseline
是end
。
规格
Specification | Status | Comment |
---|---|---|
CSS Box Alignment ModuleThe definition of 'place-self' in that specification. | Working Draft | Initial definition |
浏览器兼容性
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 59 | ? | 45.0 (45.0) | ? | ? | No support |
Feature | Android Webview | Chrome for Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Basic support | 59 | 59 | ? | (Yes) | ? | No support | ? |