How would I reverse a css transition property width?

前端 未结 2 1840
粉色の甜心
粉色の甜心 2021-01-24 14:28

So I want to make a css animation property where the width extends toward the left but it always extends to the right. I am trying to figure how to make the width extend left in

2条回答
  •  无人及你
    2021-01-24 14:39

    Adjust the left value as well:

    Updated Fiddle

    div {
        position:absolute;
        bottom:130px;
        left:130px;
        width:100px;
        height:100px;
        background:red;
        -webkit-transition:left 2s, width 2s;
    }
    div:hover {
        left:30px;
        width:200px;
    }
    

提交回复
热议问题