LoginSignup
0
0

More than 3 years have passed since last update.

cssで回転アニメーション

Posted at

・transform: rotate(1turn);というアニメーションを使うと要素が1回転する

.parent {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.anim {
    background-color: aqua;
    width: 100px;
    height: 100px;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(1turn);
    }
}
import React from 'react'
import './AnimPage.css'

export const AnimPage = () => {
    return (
        <>
            <div className="parent">
                <div className="anim"></div>
            </div>
        </>
    )
}

結果
ezgif.com-gif-maker.gif

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0