CSS Hover効果の練習


幅と高さの速度をトランジションに適用します.
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <style>
        .parent {
            width: 500px;
            height: 200px;
            position: center;
        }

        .child {
            position: absolute;
            width: 25px;
            height: 25px;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: black;
            transition: width 0.7s, height 0.6s;
            border-radius: 100%;
        }

        .child:hover {
            width: 80%;
            height: 80%;
            background-color: black;
            transition: width 0.8s, height 0.5s;
        }


    </style>

</head>
<body>
<div class="parent">
    <div class="child"></div>
</div>

</body>
</html>