1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

cssで画像を回転させるアニメーション

Posted at

実際に画像を回転させているページはこちら

<div>
	<style>
		* {
			padding: 0;
			margin: 0;
		}
		.base {
            //背景にグラデーション
			position: relative;
			background: linear-gradient(rgb(24, 176, 218), rgb(255, 255, 255));
			height: 500px;
			width: 100%;
		}

		.triangle img {
			animation: 3s linear infinite rotation1;
			width: 100%;
		}

		.f1 {
			position: absolute;
			top: 50px;
			left: 20%;
			width: 80px;
		}

		.f1 img {
			filter: hue-rotate(80deg);
		}

		.f2 {
			position: absolute;
			top: 150px;
			left: 40%;
			width: 240px;
		}

		@keyframes rotation1 {
			0% {
				transform: rotate(0);
			}

			100% {
				transform: rotate(360deg);
			}
		}
	</style>
	<div class="base">
		<div class="triangle f1"><img src="img.png"></div>
		<div class="triangle f2"><img src="img.png"></div>
	</div>
</div>
1
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?