简体   繁体   中英

Are the -webkit or -moz or whatever properties really necessary?

I wanted to put box shadow on an element, this time instead of filling the parameters manually, I used an online generator which gave me an output like this:

-webkit-box-shadow: 0px 10px 7px -8px rgba(0,0,0,0.25);
-moz-box-shadow: 0px 10px 7px -8px rgba(0,0,0,0.25);
box-shadow: 0px 10px 7px -8px rgba(0,0,0,0.25);

But its just the same thing 3 times over, I'd get it if there were some parametric differences between different browser implementations but in this case there aren't any. Also, just plain old

box-shadow: 0px 10px 7px -8px rgba(0,0,0,0.25);

works in all modern browsers anyway so why would I want to bloat my css file?

Are the -webkit or -moz or whatever properties really necessary?

Do you want to use experimental / unstable / non-standard CSS properties that are at the bleeding edge of support in the browsers they appear in?

Then yes.

Do you want to use stable, standard CSS properties that have had their specs finalised and will only work in browsers that think they have a robust implementation?

Then no.


And related to that — "Is box-shadow 'experimental / unstable / non-standard'"?

See the support chart : Not these days.

It depends on your asnwer to question;

Should my web app work on older browsers?

  • Yes!

Use the vendors, but consider some tools which will do it for you. Check: https://github.com/postcss/autoprefixer

  • No:)

But are you sure? Some users use PCs in their work with Windows Vista and IE10 and they cannot change it becouse of license and boss politics.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM