3
In CSS there are some properties that need a prefix for some browsers, for example:
-webkit-transition: all 4s ease;
-moz-transition: all 4s ease;
-ms-transition: all 4s ease;
-o-transition: all 4s ease;
transition: all 4s ease;
If I want to change these properties of an element by Javascript, I use:
document.querySelector('#myElment').style.transition = 'all 4s ease';
When moving the property
style.transition
is enough to work in all browsers?Is it necessary to apply a prefix? Which ones?
The properties that need to apply these prefixes are the memas that need to apply CSS prefixes?
I need to apply this prefix to all browsers (as well as CSS) or just to each browser?
I must change these properties so that the latter is always without prefix so that it has priority over the others (when available) or whatever?
Relacionados: https://answall.com/questions/3674/%C3%89-necess%C3%A1rio-adicionar-prefixos-em-algumas-propriedades-do-css/
– hugocsl
Related2: https://answall.com/questions/245870/sorts
– hugocsl
As the question is a little broad, Javascript also has the function of changing CSS properties dynamically, so what you use in CSS should be the same in JS, what changes is only the syntax camelCase that the JS works, without hyphens. For example.:,
.style.webkitTransition
,.style.mozTransition
etc... If the propertytransition
requires a prefix for a certain browser, only.style.transition
will have no effect.– Sam