0
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?

CSSだけで作れる!ホバーエフェクト5選【初心者向けまとめ】

0
Posted at

CSSだけで作れる!ホバーエフェクト5選
【初心者向けまとめ】

CSSだけで「おっ」と思わせるホバーエフェクトを5つ紹介します。
JavaScript不要なので、初心者でもコピペで即使えます!

1. ボタンがふわっと浮く

button {
  transition: transform 0.3s ease;
}
button:hover {
  transform: translateY(-3px);
}

2. テキストに下線がスライドする

a {
  position: relative;
  text-decoration: none;
}
a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: #3498db;
  transition: width 0.3s ease;
}
a:hover::after {
  width: 100%;
}

3. 画像がズームインする

img {
  transition: transform 0.3s ease;
}
img:hover {
  transform: scale(1.1);
}

4. 背景色がスッと変わる

div {
  background-color: #eee;
  transition: background-color 0.3s ease;
}
div:hover {
  background-color: #ddd;
}

5. シャドウが強調されるカード

.card {
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s ease;
}
.card:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

おわりに

CSSだけでも、ちょっとした工夫で印象的なUIが作れます。
ぜひ自分のサイトやポートフォリオに取り入れてみてください!

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?