为什么在CSS3中有-moz-XXX和-webkit-XXX? [英] Why there is -moz-XXX and -webkit-XXX in the CSS3?

查看:193
本文介绍了为什么在CSS3中有-moz-XXX和-webkit-XXX?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最讨厌CSS3的东西是,总是有两个属性,你应该放一个效果。我认为这不是专业,并增加CSS的大小。例如,为什么他们不统一 -webkit-border-radius -moz-border-radius code> border-radius

The thing I hate most in CSS3 is that there is always two properties you should put to do one effect. I think this is not professional, and increase the CSS size. For example, why don't they unite -webkit-border-radius and -moz-border-radius in border-radius

想象一下,如果我们有10个浏览器,我们写10行来做圆角效果吗?任何人都可以解释?

Imagine if we have 10 browsers, will we write 10 lines to do a rounded corner effect? Anyone can explain?

推荐答案

这是因为它们是供应商特定的。 -webkit - -moz - - 前缀属性是标准属性。 命名空间允许供应商测试新的酷功能,如果他们是伟大的,他们可以纳入标准。这是CSS3发生了什么:Mozilla和Webkit团队尝试了很酷的事情,现在他们将成为标准。它还没有完成。最终它将成为一个一致的 border-radius 属性。

It's because they're vendor-specific. -webkit- and -moz- -prefixed properties are not standard properties. That "namespacing" allows vendors to test new cool features, and if they're great, they can be incorporated into the standards. This is what is happening with CSS3: Mozilla and the Webkit team tried cool things, and now they're going to become standard. It's just not done yet. Eventually it'll become a consistent border-radius property.

这是一个明确的方式,预计在所有浏览器上工作。例如, -webkit-transition-property 只适用于基于Webkit的浏览器。

It's a clear way to indicate that something is not expected to work on all browsers. For instance, -webkit-transition-property only works on Webkit-based browsers.

无论如何, -webkit-border-radius -moz-border-radius 不完全相同。这是因为每个供应商,即使他们做类似的事情,允许按照他们想要的方式实现功能。标准将建立一个标准的方式,但每个人都可以自由地在自己的命名空间内做任何他们想要的。

Anyways, -webkit-border-radius and -moz-border-radius don't exactly work the same. It's because each vendor, even though they're doing similar things, are allowed to implement features the way they want. The standard will establish a standard way, but everyone is free to do whatever they want within their own namespace.

这篇关于为什么在CSS3中有-moz-XXX和-webkit-XXX?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆