Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • jQuery
  • AngularJS
  • ReactJS
  • Next.js
  • React Native
  • NodeJS
  • Express.js
  • MongoDB
  • MERN Stack
  • PHP
  • WordPress
  • Bootstrap
  • Tailwind
  • CSS Frameworks
  • JS Frameworks
  • Web Development
Open In App
Next Article:
How to Create iPod Template using HTML and CSS ?
Next article icon

How to design Animated Product Card Template using HTML and CSS ?

Last Updated : 24 Jul, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

In the dynamic world of web development, where creating engaging and visually appealing user interfaces is key, one effective strategy to captivate your audience involves seamlessly incorporating animated elements into your design. In this article, we will guide you through the process of creating a visually appealing animated product card template using HTML and CSS. Animated product cards not only enhance user engagement but also add a dynamic touch to your web applications, making them more interactive and user-friendly.

Preview

Screenshot-2024-01-04-163455

Approach

  • Create a simple HTML structure with a container and a card div for the product and include an image, course details, and a dropdown for course validity (size).
  • Apply basic styling to create a clean and visually appealing product card by using transitions for smooth hover effects on the card, image, and content.
  • Implement hover effects to enhance user interaction and enlarge the card and add a subtle shadow on hover for a dynamic appearance.
  • Style the dropdown menu for course validity with a clean and consistent look also ensure the dropdown has a smooth transition when selected.
  • Include a 'Buy Now' and 'Add to Cart' button with a vibrant color that changes on hover and create a link to prompt user action and complete the product card design.

Example: In this example, we will see how to create a Product Card using HTML and CSS.

HTML
<!DOCTYPE html> <html lang="">  <head>     <meta charset="utf-8">     <meta name="viewport"            content="width=device-width,                     initial-scale=1.0">      <link rel="stylesheet"            type="text/css"           href="styles.css">     <title>T-shirt Product Card</title> </head>  <body>     <div class="container">         <div class="card">             <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20240104153658/1-(1).jpg"                   alt="t-shirt">             <div class="contentBx">                 <h2>DSA SELF-PACED COURSE</h2>                 <p>Just Grab the Offer Within 24days</p>                 <div class="size">                     <label for="size">Course Validity</label>                     <select id="size">                         <option value="s">3 Months</option>                         <option value="m">6 Months</option>                         <option value="l">9 Months</option>                         <option value="xl">12 Months</option>                     </select>                 </div>                 <a href="#" class="buyBtn">Buy Now</a>                 <a href="#" class="cartBtn">Add to Cart</a>             </div>         </div>     </div> </body>  </html> 
CSS
/* styles.css */ @import url( 'https://fonts.googleapis.com/css?family=Poppins:100,300,400,500,600,700,800,800i,900&display=swap');  * {     padding: 0;     margin: 0;     font-family: 'Poppins', sans-serif;     box-sizing: border-box;     font-weight: 400; }  body {     display: flex;     justify-content: center;     align-items: center;     min-height: 100vh;     background: #f5f5f5; }  .container {     position: relative;     width: 320px; }  .card {     position: relative;     width: 100%;     background: #fff;     border-radius: 10px;     overflow: hidden;     box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);     transition: transform 0.3s, box-shadow 0.3s;     cursor: pointer;     transform-origin: center bottom; }  .card:hover {     transform: scale(1.05);     box-shadow: 0 8px 90px rgba(0, 0, 0, 0.2); }  .card img {     width: 100%;     height: auto;     display: block;     border-bottom: 1px solid #e0e0e0;     transition: transform 0.5s; }  .card:hover img {     transform: scale(1.1); }  .contentBx {     padding: 20px;     text-align: center;     transition: opacity 0.5s; }  .card:hover .contentBx {     opacity: 1; }  .contentBx h2 {     font-weight: 600;     color: #333;     margin-bottom: 10px; }  .contentBx p {     color: #666;     margin-bottom: 20px; }  .size {     display: flex;     justify-content: center;     align-items: center;     margin-bottom: 20px; }  .size label {     margin-right: 10px;     color: #666; }  .size select {     padding: 8px;     border: 1px solid #ccc;     border-radius: 4px;     outline: none; }  .buyBtn {     display: inline-block;     padding: 10px 20px;     background: #fff;     border-radius: 10px;     text-decoration: none;     color: #fff;     font-weight: 600;     color: black;     transition: background 0.3s; }  .buyBtn:hover {     background: #1BBFE9; }  .cartBtn {     display: inline-block;     padding: 10px 20px;     background: #fff;     border-radius: 10px;     text-decoration: none;     color: black;     font-weight: 600;     margin-left: 10px;     transition: background 0.3s; }  .cartBtn:hover {     background: #1BBFE9; } 

Output:


Next Article
How to Create iPod Template using HTML and CSS ?

D

dhruvi1267be21
Improve
Article Tags :
  • Web Technologies
  • Geeks Premier League
  • Web Templates
  • Geeks Premier League 2023

Similar Reads

  • How to Create iPod Template using HTML and CSS ?
    The iPod template will create the look and feel of a classic iPod, with a sleek design and functional layout. The code creates a visually appealing iPod-like template with responsive design features and FontAwsome icons are used to enhance the look of the project. PreviewApproachFirst, create the st
    3 min read
  • Create a Product Detail Page Template using HTML and CSS
    In this article, we will create a Product Details Layout Template using HTML & CSS. This Card is generally used in e-commerce websites to make the product more presentable and show details clearly. The card-like structure includes details such as product name, price, and a concise description, p
    4 min read
  • Design Animated Google Loader using HTML and CSS
    The Google Loader consists of 4 circles with blue, red, yellow, and green colors. You can easily create them using HTML and CSS, and animate them to move the same as in the final output. The animation is just translating the circle in the Y axis with .25s time delay. For non-stop and fluid animation
    2 min read
  • How to make Animated Click Effect using HTML CSS and JavaScript ?
    In this article, we will see how to make an Animated Click Effect using HTML CSS, and JavaScript. We generally see animations on modern websites that are smooth and give users a good experience. Here, we will see when the user clicks on the button only then some animation would appear. The animation
    3 min read
  • How to make a Animated Table using HTML and CSS ?
    Table is an arrangement of data in rows and columns, or possibly in a more complex structure. Tables are widely used in communication, research, and data analysis. In this article, we are going to create a Table with animation over its columns. We are going to implement it using HTML and CSS. Approa
    3 min read
  • Design a Rotating card effect using HTML and CSS
    Rotating cards are the effect on cards that will rotate to some degree when you hover your mouse over them. There will be information, links, or images on the card which will be visible when you hover over the cards. In this article, you’re going to learn how to make rotating cards on your website u
    3 min read
  • How to design Meet the Team Page using HTML and CSS ?
    You will learn how to create a simple and responsive “Meet the Team” page using HTML and CSS. We will use HTML to structure the content of the page, such as the headings, paragraphs, images, and links, and then we use CSS to style the elements of the page, such as the colors, fonts, and layout. Here
    5 min read
  • Design a Virtual Credit Card Template using HTML and CSS
    In this article, we will design a Virtual Credit Card template using HTML and CSS for a modern and interactive user experience. This design includes spaces for the card number, name, and expiry date. HTML will be used to structure the layout, while CSS will add styling for a visually pleasing and be
    3 min read
  • Design a Image Hover Effect Color Transition template using HTML and CSS
    The article uses HTML and CSS to create the template for an Image Hover Effect with Color Transition. This template adds an interactive element to your web design by smoothly transitioning colors when users hover over an image. You can create a dynamic effect that enhances visual engagement by utili
    2 min read
  • How to Create Pricing Table using HTML and CSS ?
    Nowadays, every website contains pricing tables, such as e-commerce, e-tech, and even tourism websites also have pricing tables as they contain their plans, cost of plans, and information about plans to buy new facilities. So the pricing table is one of the most important parts of websites that sell
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences