想用flexbox实现下边header中“返回”在左,“这是标题”在中的效果。
本来想这样就可以:
header{
display:flex;
justify-content:center;
}
back_link{
justify-self:flex-start;
}
然后发现原来flexbox是没有justify-self的。
查了下倒是可以用margin:auto
调整item单独位置。但只适用于一左一右的情况,无法一左一中。
我目前能想到的就是加一个空的div
,然后在header
里用justify-content:space-between
……
倒是可以实现,但肯定不是好办法
想问下各位有什么建议? 不是flexbox但非常好用的也行。
Hi this is a selution, it is at MDN document like: https://developer.mozilla.org...
you can using margin left and right to auto value to get result.
