Do I still have to use all five vendor prefixes for the CSS box-shadow property?

被刻印的时光 ゝ 提交于 2019-12-09 14:30:44

问题


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?


回答1:


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.




回答2:


Maybe Prefix free will help.

It will add the prefixes that are required per browser.




回答3:


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.



来源:https://stackoverflow.com/questions/7757622/do-i-still-have-to-use-all-five-vendor-prefixes-for-the-css-box-shadow-property

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!