CSS :hover and transform

前端 未结 3 1931
旧时难觅i
旧时难觅i 2021-01-15 12:12

I have this situation:

Html:

css:

.button { 
   position:absolute; 
   lef         


        
3条回答
  •  再見小時候
    2021-01-15 12:26

    Try like this: Demo

    CSS:

     .button {
        width:auto;
        background-color:red;
        color:#fff;
        transform: translateY(50px);
        -webkit-transition: 1s ease-in-out;
        -moz-transition: 1s ease-in-out;
        -o-transition: 1s ease-in-out;
        transition: 1s ease-in-out;
    }
    .button:hover {
        background-color:blue;
        color:#fff;
        -webkit-transform: translateY(50px) scale(1.2);
        -moz-transform: translateY(50px) scale(1.2);
        -o-transform: translateY(50px) scale(1.2);
        -ms-transform: translateY(50px) scale(1.2);
        transform: translateY(50px) scale(1.2);
    }
    

    HTML:

    
    
    
    
    

提交回复
热议问题