我在
MDN CSS主页上看到以下新闻:
Gecko’s support of flexible Boxes has been adapted to match a recent specification clarification: from Firefox 23
::before
and::after
will be flex items,and as such can be repositioned usingorder
andalign-self
.
(May 3rd,2013)
它指的是什么规格?
我在CSS Flexible Box Layout Module中找不到:: before / :: after之前的任何引用.
解决方法
这是在
bug 867454中实现的.没有实现它是一个错误,正如评论#0所说.
spec说:
The contents of a flex container consists of zero or more flex items: each in-flow child of a flex container becomes a flex item,and each contiguous run of text that is directly contained inside a flex container is wrapped in an anonymous flex item.
这确实包括::之前/ ::之后的伪元素(至少mozilla人们现在这样解释它,我同意).
“Firefox 23 for developers”还具有此信息,明确地将:: before和:: after称为“in-flow”.
In-flow ::after and ::before pseudo-elements are now flex items (bug 867454).