我是否仍然需要对 CSS box-shadow 属性使用所有五个供应商前缀?
当声明 box-shadow
或 text-shadow
或渐变时,您还需要所有前缀吗?
-webkit-box-shadow: inset 0 0 1px 1px #e3e3e3;
-moz-box-shadow: inset 0 0 1px 1px #e3e3e3;
-ms-box-shadow: inset 0 0 1px 1px #e3e3e3;
-o-box-shadow: inset 0 0 1px 1px #e3e3e3;
box-shadow: inset 0 0 1px 1px #e3e3e3;
我理解主要的:
-webkit-
-moz-
box-shadow
但是随着浏览器的增长,我想尝试获得关于此时是否有必要使用5个前缀的更新观点?
想法、评论?
When declaring say box-shadow
or text-shadow
or gradients for that matter, do you still need all the prefixes?
-webkit-box-shadow: inset 0 0 1px 1px #e3e3e3;
-moz-box-shadow: inset 0 0 1px 1px #e3e3e3;
-ms-box-shadow: inset 0 0 1px 1px #e3e3e3;
-o-box-shadow: inset 0 0 1px 1px #e3e3e3;
box-shadow: inset 0 0 1px 1px #e3e3e3;
I understand the main ones:
-webkit-
-moz-
box-shadow
But with the growth of browsers, I wanted to try to get an updated view on whether it is necessary to use 5 prefixes at this moment?
Thoughts, comments?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
caniuse.com 有一个很好的表格,显示哪些浏览器需要前缀,哪些不支持
box-shadow
根本没有。(需要前缀的版本在版本号下方具有该前缀,如下面的屏幕截图所示。)
是否您需要为您正在构建的任何网站使用前缀,具体取决于网站现有/目标受众实际使用的浏览器。
caniuse.com has a good table showing which browsers require the prefix, and which don’t support
box-shadow
at all.(Versions that require a prefix have that prefix underneath the version number, as in the screenshot below.)
Whether you need to use the prefixes for whatever site you’re building depends on which browsers are actually used by the site’s existing/intended audience.
也许免费前缀会有所帮助。
它将添加每个浏览器所需的前缀。
Maybe Prefix free will help.
It will add the prefixes that are required per browser.
随着浏览器的不断改进,很难确定是否可以删除某些 CSS3 添加的供应商前缀。因为 CSS3 是“模块化的”,并且在语法和浏览器支持方面都经历了缓慢的变化 - 最好坚持使用供应商前缀,直到所有这些怪癖都被 W3C 和浏览器等过滤掉。如上所述,您始终可以查看特定浏览器或帮助站点以获取有关旧版浏览器支持的信息。
With the continued improvement of browsers, it has become hard to determine whether it is possible to drop the vendor prefixes of certain CSS3 additions. Because CSS3 is "modular-ized" and goes through slow changes both in syntax and browser support - it is probably best to stick with the vendor prefixes until all of these quirks have been sifted out by the W3C and browsers alike. As stated above, you can always look to specific browsers or help sites for information about legacy browser support.
所有现代浏览器都支持
box-shadow
。不再需要供应商前缀。All modern browsers support
box-shadow
. The vendor prefixes are not required anymore.