我在 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.
这确实包括 ::before
/::after
伪元素(至少 mozilla 的人现在这样解释它,我同意)。
"Firefox 23 for developers"还具有此信息,明确将 ::before
和 ::after
称为“流入”。
In-flow ::after and ::before pseudo-elements are now flex items (bug 867454).
关于css -::before/::after + MDN 中的 flexbox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40963647/