在线文档教程
CSS

证明自我 | justify-self

justify-self

CSS justify-self属性限定了沿着相应的轴证明其容器内的盒的方式。

/* Basic keywords */ justify-self: auto; justify-self: normal; justify-self: stretch; /* Positional alignment */ justify-self: center; /* Pack item around the center */ justify-self: start; /* Pack item from the start */ justify-self: end; /* Pack item from the end */ justify-self: flex-start; /* Pack flex item from the start */ justify-self: flex-end; /* Pack flex item from the end */ justify-self: self-start; justify-self: self-end; justify-self: left; /* Pack item from the left */ justify-self: right; /* Pack item from the right */ /* Baseline alignment */ justify-self: baseline; justify-self: first baseline; justify-self: last baseline; /* Overflow alignment (for positional alignment only) */ justify-self: safe center; justify-self: unsafe center; /* Global values */ justify-self: inherit; justify-self: initial; justify-self: unset;

语法

这个属性可以采取三种不同的形式之一:

  • 基本关键字:关键字值之一normalautostretch

auto使用的值是值justify-items父母箱的财产,除非框中有没有父母,或绝对定位,在这些情况下,auto代表normal

  • 在块级布局中,关键字是一个同义词start

start物品在适当的轴线上朝向对齐容器的起始边缘彼此齐平地包装。

这仅适用于柔性布局项目。对于不是柔性容器的子项的项目,该值被视为像start

这仅适用于柔性布局项目。对于不是柔性容器的子项的项目,该值被视为像end

first baseline

last baseline指定参与第一次或最后一次基线对齐:将框的第一个或最后一个基准集的对齐基线与其基准共享组中所有框的共享第一个或最后一个基准集中的相应基线对齐。

回退对齐first baselinestartlast baseline是的end

规范

SpecificationStatusComment
CSS Box Alignment ModuleThe definition of 'justify-self' in that specification.Working DraftInitial definition

浏览器兼容性

FeatureFirefox (Gecko)ChromeEdgeInternet ExplorerOperaSafari
Basic support45 (45)?????

FeatureFirefox Mobile (Gecko)AndroidAndroid WebviewEdgeIE PhoneOpera MobileSafari MobileChrome for Android
Basic support45.0 (45)???????