Close Menu

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    How to create 3D Card Hover Animation using HTML and CSS

    8 July 2026

    How to make Login Form Lamp using HTML and CSS

    4 July 2026

    How to make Social Media Button Hover Clock using HTML and CSS

    2 July 2026
    Facebook X (Twitter) Instagram YouTube Telegram Threads
    Coding StellaCoding Stella
    • Home
    • Blog
    • HTML & CSS
      • Login Form
    • JavaScript
    • Hire us!
    Coding StellaCoding Stella
    Home » How to create 3D Card Hover Animation using HTML and CSS
    HTML & CSS

    How to create 3D Card Hover Animation using HTML and CSS

    Coding StellaBy Coding Stella8 July 2026Updated:8 July 2026No Comments3 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Email WhatsApp Copy Link

    Create a stunning 3D Card Hover Animation using HTML and CSS! 🎨✨ This effect makes cards smoothly expand, tilt, and reveal hidden details with a realistic 3D perspective when you hover over them, creating an eye-catching interactive experience.

    We’ll use:

    • HTML to build the card structure with images and captions.
    • CSS to add the layout, custom styling, perspective, transforms, transitions, and hover animations that bring the cards to life.

    This project is perfect for portfolios, gaming websites, product showcases, or any modern UI where you want your cards to feel more dynamic and engaging. Let’s build this awesome 3D hover animation from scratch!

    HTML :

    The HTML creates two character cards using the <figure> element. Each card contains an <img> to display the character image and a <figcaption> to show its name. The page links to an external CSS file that handles all the styling and hover animations, while the HTML simply provides the structure of the cards.

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="UTF-8">
        <title>3D Card hover effect | @coding.stella</title>
        <link rel="stylesheet" href="./style.css">
    </head>
    
    <body>
    
        <figure>
            <img src="./Images/necro.png" alt="Necromancer">
            <figcaption>The Necro</figcaption>
        </figure>
        <figure>
            <img src="./Images/druide.png" alt="Druid">
            <figcaption>The Druid</figcaption>
        </figure>
    
    </body>
    </html>

    CSS :

    The CSS styles the page with a full-screen background, custom font, and a grid layout to place the cards side by side. Each card uses a ::before pseudo-element to add a background image, while the main image and caption are positioned using CSS Grid. On hover, the character image enlarges, the background tilts with a 3D perspective effect, its brightness decreases, and the caption flips up into view, creating a smooth and attractive 3D hover animation using transform, transition, filter, and perspective.

    @font-face{ font-display:swap;
      font-family: "Exoct";
      src: url("./films.EXH_____.ttf")
     }
    
    body {
      margin: 0;
      min-height: 100vh;
      display: grid;
      grid-auto-flow: column;
      grid-auto-columns: min(230px,35vmin);
      place-content: end center;
      gap: 50px;
      background: 
        linear-gradient(#0000,rgb(50 50 50 / 88%)),
        url(./Images/Bg.png) top/cover;
    }
    
    figure {
      width: 100%;
      aspect-ratio: 1;
      margin: 0 0 60px;
      padding: 5px 20px 0;
      box-sizing: border-box;
      display: grid;
      grid-template-rows: 100%;
      cursor: pointer;
      position: relative;
      filter: drop-shadow(0 0 20px rgb(0 0 0/50%));
    }
    figure:before {
      content: "";
      position: absolute;
      z-index: -1;
      inset: 0;
      background: top/cover;
      transform-origin: bottom;
      filter: brightness(.9);
      transition: .5s;
    }
    figure:before {
      background-image: url(./Images/necro-back.png)
    }
    figure + figure:before {
      background-image: url(./Images/druid-back.png)
    }
    img {
      grid-area: 1/1;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: top;
      filter: contrast(.8) brightness(.7);
      place-self: end center;
      transition: .5s;
    }
    figcaption {
      grid-area: 1/1;
      width: calc(100% + 40px);
      font-family: Exoct;
      color: #fff;
      font-size: min(32px,5vmin);
      text-align: center;
      place-self: end center;
      transform: perspective(500px) translateY(100%) rotateX(-90deg);
      backface-visibility: hidden;
      transform-origin: top;
      background: #000;
      transition: .5s;
    }
    figure:hover img {
      width: 130%;
      height: 255%;
      filter: contrast(1);
    }
    figure:hover::before {
      filter: brightness(.3);
      transform: perspective(500px) rotateX(60deg);
    }
    figure:hover figcaption{
      transform: perspective(500px)translateY(100%) rotateX(-30deg);
    }

    And that’s it! 🎉 You’ve successfully created a 3D Card Hover Animation using HTML and CSS. By combining CSS transforms, perspective, transitions, and hover effects, you can build interactive cards that feel modern and visually engaging. Experiment with different images, colors, and animations to create your own unique designs and make your websites stand out.

    If your project has problems, don’t worry. Just click to download the source code and face your coding challenges with excitement. Have fun coding!

    Animation website
    Share. Copy Link Twitter Facebook LinkedIn Email WhatsApp
    Previous ArticleHow to make Login Form Lamp using HTML and CSS
    Coding Stella
    • Website

    Related Posts

    HTML & CSS

    How to make Login Form Lamp using HTML and CSS

    4 July 2026
    HTML & CSS

    How to make Social Media Button Hover Clock using HTML and CSS

    2 July 2026
    JavaScript

    How to create Tower Block Game using HTML CSS and JS

    1 July 2026
    Add A Comment
    Leave A Reply Cancel Reply

    Trending Post

    Master Frontend in 100 Days Ebook

    2 March 202432K Views

    How to make Modern Login Form using HTML & CSS | Glassmorphism

    11 January 202431K Views

    How to make I love you Animation in HTML CSS & JavaScript

    14 February 202424K Views

    How to make Valentine’s Day Card using HTML & CSS

    13 February 202415K Views
    Follow Us
    • Instagram
    • Facebook
    • YouTube
    • Twitter
    ads
    Featured Post

    How to Become a Full-Stack Web Developer?

    24 January 2024

    How to Make Form Validation in HTML CSS and JavaScript

    11 December 2023

    How to make Subway Surfers Game using HTML and JavaScript

    27 May 2026

    How to create Parallax Scroll Animation using HTML CSS and JS

    17 August 2025
    Latest Post

    How to create 3D Card Hover Animation using HTML and CSS

    8 July 2026

    How to make Login Form Lamp using HTML and CSS

    4 July 2026

    How to make Social Media Button Hover Clock using HTML and CSS

    2 July 2026

    How to create Tower Block Game using HTML CSS and JS

    1 July 2026
    Facebook X (Twitter) Instagram YouTube
    • About Us
    • Privacy Policy
    • Return and Refund Policy
    • Terms and Conditions
    • Contact Us
    • Buy me a coffee
    © 2026 Coding Stella. Made with 💙 by @coding.stella

    Type above and press Enter to search. Press Esc to cancel.

    Ad Blocker Enabled!
    Ad Blocker Enabled!
    Looks like you're using an ad blocker. We rely on advertising to help fund our site.
    Okay! I understood