0

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?

user81993
  • 6,167
  • 6
  • 32
  • 64
  • You said it yourself. MODERN. – 1x2x3x4x Aug 13 '15 at 10:59
  • 1
    Box shadow should not be a problem without the prefixes, but for example transforms without the -webkit prefix won't work on some mobile devices. I consult [caniuse](http://caniuse.com) every time I am not sure. – drys Aug 13 '15 at 11:02
  • That also my question vote up :-) – Nabi Aug 13 '15 at 11:07
  • Possible duplicate - http://stackoverflow.com/questions/14811573/what-is-the-purpose-of-css-prefixes – Paulie_D Aug 13 '15 at 11:12

2 Answers2

4

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.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • Before starting to use autoprefixer, I found this reference useful - [http://shouldiprefix.com/](http://shouldiprefix.com/). – robjez Aug 13 '15 at 11:04
0

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.

Jinx
  • 348
  • 3
  • 14