订购供应商前缀的正确方法是什么? [英] What is the proper way to order vendor prefixes?
本文介绍了订购供应商前缀的正确方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
摩擦
- CSS技巧说,flexbox的
display
供应商前缀的顺序很重要.并显示一个顺序(-webkit-box
,-moz-box
,-ms-flexbox
,-webkit-flex
,flex
) - MDN 显示的顺序不同于CSS技巧并将
-moz-box
换出为-moz-flex
(-webkit-box
,-webkit-flex
,-moz-flex
,-ms-flexbox
,flex
) - 波旁酒显示了不同的顺序并引入了
box
,其他两页甚至都没有提及(-webkit-box
,-moz-box
,box
,-webkit-flex
,-moz-flex
,-ms-flexbox
,)
- CSS Tricks says that the order of the
display
vendor prefixes for flexbox is important and shows one ordering (-webkit-box
,-moz-box
,-ms-flexbox
,-webkit-flex
,flex
) - MDN shows a different order than CSS Tricks and swaps
-moz-box
out for-moz-flex
(-webkit-box
,-webkit-flex
,-moz-flex
,-ms-flexbox
,flex
) - Bourbon shows yet a different order and brings in
box
, which the other two pages don't even mention (-webkit-box
,-moz-box
,box
,-webkit-flex
,-moz-flex
,-ms-flexbox
,flex
)
问题
- 订购真的很重要吗?
- 正确的方法是什么?
推荐答案
只要W3C版本(官方属性)排在最后,就没有区别.
As long as the W3C version (the official property) comes last, there is no difference.
CSS渲染引擎将始终选择适用的最后一个属性.因此,例如,如果实际支持flex
,则您不希望Chrome跳过flex
并选择-webkit-flex
.
The CSS rendering engine will always pick the last property that applies. Hence, you don't want Chrome, for example, to skip over flex
and pick -webkit-flex
, if flex
is actually supported.
您会发现CSS-Tricks,MDN和Bourbon中供应商前缀的顺序有所不同,因为顺序无关紧要.只要注意它们的共同点:flex
最后.
You're seeing variations in the ordering of vendor prefixes in CSS-Tricks, MDN and Bourbon because the order doesn't matter. Just note what they all have in common: flex
is last.
以下是更多详细信息:
- Ordering CSS3 Properties
- Ordering of vendor-specific CSS declarations
这篇关于订购供应商前缀的正确方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文