How to automatically add browser prefix to CSS3 properties?

落花浮王杯 提交于 2019-12-02 01:09:35

问题


As you may be know, because CSS3 is not compatible with all of browsers when we use CSS3 we should add a prefix to CSS3 properties (like -moz, -webkit, -o and ...)

It is difficult to write these prefixes manually. So, is there any plugin, program or another thing to detect CSS3 properties in my CSS file and append necessary vendor prefixes to those properties ?


回答1:


There are several options that come to mind, depending on your use-case:

  • SASS with Bourbon
  • SASS with Compass
  • Less with LESS elements

  • Emmet CSS3 Abbreviations (In your text editor)

  • PrefixFree (client side js)

My personal preference is to use Compass, but the Emmet abbreviations work well if you do not want the overhead of using a CSS pre-processor.




回答2:


Here is more

Sublimetext plugin https://github.com/sindresorhus/sublime-autoprefixer?source=c




回答3:


A nice vendor prefix mixin for doing that in SASS here for those that are using SASS



来源:https://stackoverflow.com/questions/13935761/how-to-automatically-add-browser-prefix-to-css3-properties

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