How do I apply CSS3 transition to all properties except background-position?

前端 未结 6 1713
傲寒
傲寒 2020-12-13 08:26

I\'d like to apply a CSS transition to all properties apart from background-position. I tried to do it this way:

.csstransitions a {
    -webkit-transition:          


        
6条回答
  •  情歌与酒
    2020-12-13 09:03

    Hope not to be late. It is accomplished using only one line!

    -webkit-transition: all 0.2s ease-in-out, width 0, height 0, top 0, left 0;
    -moz-transition: all 0.2s ease-in-out, width 0, height 0, top 0, left 0;
    -o-transition: all 0.2s ease-in-out, width 0, height 0, top 0, left 0;
    transition: all 0.2s ease-in-out, width 0, height 0, top 0, left 0; 
    

    That works on Chrome. You have to separate the CSS properties with a comma.

    Here is a working example: http://jsfiddle.net/H2jet/

提交回复
热议问题