css3 button background color infinite transition

后端 未结 2 2017
梦如初夏
梦如初夏 2021-02-04 03:14

Is there a way to make a button\'s background color fade from grey to blue then back to gray using only css3? A good example is a default action button is cocoa? I know this c

2条回答
  •  渐次进展
    2021-02-04 04:10

    If you need fade animation on hover or such things, CSS3 transition property is your solution.

    EDIT:

    .btn {
      background-color: lightblue;
      -webkit-transition: all 0.3s ease-out;  /* Saf3.2+, Chrome */
         -moz-transition: all 0.3s ease-out;  /* FF4+ */
          -ms-transition: all 0.3s ease-out;  /* IE10 */
           -o-transition: all 0.3s ease-out;  /* Opera 10.5+ */
              transition: all 0.3s ease-out;
    }  
    
    .btn:hover {
      background-color: lightgreen;  
    }
    

提交回复
热议问题