Move image from top left to bottom right with CSS3

I went to the Internet for a long time and couldn't find it. Later, I thought of the cacl calculation attribute and solved it.

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<style>
    html,body{
        height:100%;
    }
    .ani-box {
        width: 100%;
        height: 100%;
        position: relative;
    }

    .ani {
        width: 100px;
        height: 100px;
        background: #000;
        animation: a 2s linear;
        position: absolute;
        top: 0;
        left: 0;
    }

    @keyframes a {
        0% {
            top:0;
        }
        100% {
            top:calc(100% - 100px);
        }
    }
</style>

<body>
<div class="ani-box">
<div class="ani"></div>
</div>
</body>

</html>

finished~

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324772444&siteId=291194637