CSS 3 - transition prefixes - which ones to use?

后端 未结 6 1075
一个人的身影
一个人的身影 2020-12-29 07:09

I have a question regarding the CSS vendor prefixes for transition.

This source states that \"you need to use all the usual prefixes to make this work in all browser

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-29 08:10

    http://caniuse.com/#search=transition says that you need -webkit- and plain property for modern browsers.

    -webkit-transition: all .5s ease;
    transition: all .5s ease;
    

    But it will be no problem if you add all of them, just be sure that property without prefix is the last one.

    Edit: as said in comment below, if you click on "All versions" you can see when each browser dropped prefix. For now it is better to use -moz- and -o- also.

    Edit May 2015: I highly recommend use Autoprefixer as step on your build process (like Gulp/Grunt task) or as plugin to your code editor. It provides automatic prefixing on caniuse.com browser support stats.

    Edit 2019: No need in prefixes and less and less need in Autoprefixer, future is nice :)

提交回复
热议问题