프론트엔드/컴포넌트

위로 증가하는 바 그래프

syleemomo 2024. 2. 16. 17:05
728x90
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>

        <div class="bar">1</div>
    
    <script src="app.js"></script>
</body>
</html>
body{
    margin: 0;
    height: 100vh;
}
.bar{
    width: 50px;
    background-color: aqua;
    animation: grow 1s linear .5s forwards;
    position: absolute; bottom: 0;
}

@keyframes grow{
    from{
        height: 0;
    }
    to{
        height: 100%;
    }
}
728x90