¿Una forma sencilla de combinar las tres clases de CSS para -moz, -webkit y regular?

It gets really annoying, especially when using these techniques as much as I am, to not only add these, but then to change them even the slightest, because I have to do it three times, rather than just once.


-webkit-border-radius: 5px;
-moz-border-radius: 5px;

There must be some way to only have to do this once, a plugin or something.

preguntado el 10 de marzo de 12 a las 04:03

¿Qué tal un complemento de jQuery (for what is essentially a standalone script)? -

3 Respuestas

Use a CSS preprocesser like SASS. The mixin capability allows something like this:

@mixin border-radius($radius) {
    -webkit-border-radius: $radius;
    -moz-border-radius: $radius;
     border-radius: $radius;

Then you can just reference the mixin like this:

@include border-radius(5px);

respondido 10 mar '12, 04:03

O usar Compass. It includes a ton of CSS3 mixins baked in, including border-radius. - estantería

Yes there is a plugin called sin prefijo

Mira esto http://leaverou.github.com/prefixfree/

respondido 10 mar '12, 04:03

puedes usar menos

o usar Sass

and I prefer Less because it more simple and easiest

respondido 10 mar '12, 04:03

In what ways do you find LESS easier than SASS? - estantería

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.