DEV Community

Cover image for CSS Animation: Card Width expand on hover
Jon Snow
Jon Snow

Posted on

23 2 2 3 3

CSS Animation: Card Width expand on hover

In this tutorial, you will learn how to create a pure CSS card width expand animation with hover effect.

Card Width expand on hover

If you want to create this type of animation, simply use the following CSS code snippet.

CSS Code



.container {
  display: flex;
}
.card {
  height: 200px;
  background: rgb(48, 207, 232);
  flex: 1;
  transition: 0.3s;
}
.card:hover {
  flex: 3;
  background: rgb(12, 171, 195);
}


Enter fullscreen mode Exit fullscreen mode

We made a image gallery animation using this code snippet

Card Width expand on hover

Source Code



Thanks for Reading ❤️! Check my website Demo coding for updates about my latest CSS Animation, CSS Tools, and some cool web dev tips. Let's be friends!

Don't forget to subscribe to our channel : Demo code

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay