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:
Create a Tiles Layout Template using HTML and CSS
Next article icon

Create a Product Detail Page Template using HTML and CSS

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

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, presented in a clean and visually appealing format. The layout incorporates subtle hover effects for enhanced user interaction, providing a polished and responsive product display.

Preview

productsnap-(1)
Preview

Approach

  • Create a basic card structure using HTML. Use <img> element to show the product image and <div> element to show the details.
  • The card layout within the container includes an image, course information, and a description. Make the three same card layouts with different course names, and respective details.
  • With the help of class and id give style to the element inside <style> element in the head section of the HTML file.
  • To give the Animation effect we have used transition and transform properties whenever the user hovers the Card.

Example: The below example shows how to Create a Product Details layout template using HTML & CSS.

HTML
<!DOCTYPE html> <html lang="en">  <head>     <meta charset="UTF-8">     <meta name="viewport"            content="width=device-width,                    initial-scale=1.0">     <title>         Product Details layout template     </title>     <link rel="stylesheet"           href="style.css"> </head>  <body>     <div class="container_box">          <!-- Card 1 -->         <div class="container">             <div>                 <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20230927120134/Print-design-vs-web-design-copy.webp"                     alt="GeeksforGeeksImage">                 <div>                       <span class="response">                         40k+ interested Geeks                     </span>                     <span class="ratings">                         Ratings: 5.0                     </span>                 </div>             </div>             <div class="info front cardutility">                 <div class="course-title">                     Web Design Course                 </div>                 <div class="des cardutility">                     <div>                         Complete guidance from                         Biggner to Advance                     </div>                     <div>                         Price:                         <span class="rates">Rs.7000</span>                         <span class="explore_link">                             <a href="#"                                 class="link_a">                                 Explore                             </a>                         </span>                     </div>                 </div>             </div>         </div>          <!-- Card 2 -->         <div class="container">             <div>                 <img src= "https://media.geeksforgeeks.org/img-practice/prod/courses/1699342871/Web/Content/full-stack-node-thumbnail.webp"                     alt="GeeksforGeeksImage">                 <div>                     <span class="response">                         70k+ interested Geeks                     </span>                     <span class="ratings">                         Ratings: 5.0                     </span>                 </div>             </div>             <div class="info front cardutility">                 <div class="course-title">                     Full Stack Course                 </div>                 <div class="des cardutility">                     <div>                         Complete guidance                         from Biggner to Advance                     </div>                     <div>                         Price:                         <span class="rates">                             Rs.9000                         </span>                         <span class="explore_link">                             <a href="#"                                 class="link_a">                                 Explore                             </a>                         </span>                     </div>                 </div>             </div>         </div>          <!-- Card 3 -->         <div class="container">             <div>                 <img src= "https://media.geeksforgeeks.org/img-practice/prod/courses/1699342871/Web/Content/dsa-self-paced-thumbnail.webp"                      alt="GeeksforGeeksImage">                 <div>                       <span class="response">                         20k+ interested Geeks                     </span>                     <span class="ratings">                         Ratings: 5.0                     </span>                 </div>             </div>             <div class="info front cardutility">                 <div class="course-title">                     DSA JAVA and C++ Course                 </div>                 <div class="des cardutility">                     <div>                         Complete guidance                         from Biggner to Advance                     </div>                     <div>                         Price:                         <span class="rates">Rs.5000 </span>                         <span class="explore_link">                             <a href="#" class="link_a">                                 Explore                             </a>                         </span>                     </div>                 </div>             </div>         </div>     </div> </body>  </html> 
CSS
/* style.css*/ body {     background-color: rgb(165, 192, 201);     justify-content: center;     align-items: center;     display: flex;     color: rgb(239, 238, 220); }  .container {     height: 414px;     width: 368px;     background-color: rgb(20, 21, 82);     border: 2px solid white;     display: flex;     flex-direction: column;     justify-content: center;     align-items: center;     border-radius: 15px;     box-shadow: rgba(41, 40, 40, 0.2);     gap: 30px;     transition: transform 0.2s ease-in-out; }  .container_box {     display: flex;     height: 800px;     justify-content: center;     align-items: center;     gap: 2vw;     flex-wrap: wrap;     margin-top: 20px; }  .container:hover {     transform: scale(1.1); }  .cardutility {     height: 80px;     display: flex;     flex-direction: column;     justify-content: center;     align-items: center;     padding: 10px;     font-size: 20px;     border-radius: 10px; }  .des {     text-align: center;     padding: 5px;     margin: 1px;     border-radius: 10px;     text-justify: auto; }  .spaceicon {     gap: 10px; }  #btnid {     border-radius: 100%;     height: 50px;     width: 50px;     position: relative; }  img {     width: 340px;     height: 230px;     border-radius: 10px;     border: 5px solid white; }  .course-title {     font-size: 25px; }  .response {     margin-left: 20px; }  .ratings {     margin: 15px 0 0 80px;     padding: 3px; }  .rates {     margin-left: 3px; }  .explore_link {     border: 1px solid white;     border-radius: 5px;     margin: 2px 0 0 70px;     background-color: aliceblue; }  .link_a {     color: rgb(0, 0, 0);     text-decoration: none; }  @media only screen and (max-width: 376px) {     body {         background-color: rgb(99, 176, 201);     }      .container {         height: 300px;         width: 300px;         border-radius: 5px;         gap: 10px;     }      img {         width: 240px;         height: 130px;         border-radius: 10px;         border: 5px solid white;         margin-left: 25px;     }      .response {         margin-left: 10px;     }      .ratings {         margin: 5px 0 0 50px;         padding: 3px;     }      .course-title {         font-size: 10px;     } } 

Output:


Next Article
Create a Tiles Layout Template using HTML and CSS

S

shivanigupta18rk
Improve
Article Tags :
  • Web Technologies
  • Web Templates
  • CSS-Questions

Similar Reads

  • Create a Split layout template using HTML and CSS
    In this article, we will design a Split Layout Template that provides a responsive HTML and CSS webpage layout with a split-screen design, accommodating content in distinct left and right sections. The layout adapts to different screen sizes and features contrasting colors and subtle hover effects f
    2 min read
  • Create a Tiles Layout Template using HTML and CSS
    In this article, we will create a responsive Tiles layout template using HTML and CSS by structuring the HTML with headers, main content, and a footer. Utilize flexbox for a dynamic tiles container with individual tiles styled for responsiveness and hover effects. Tiles Layout refers to a web design
    2 min read
  • Design a Google Chrome Page Template using HTML and CSS
    Google Chrome Page Template is a replica of Google Chrome Page which can be built with the help of HTML and CSS. This project has fundamental features and design elements, a search option, along with using the FontAwsome Icons, and various CSS styling, which offer you hands-on experience in web desi
    4 min read
  • 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
  • How to design Animated Product Card Template using HTML and CSS ?
    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
    3 min read
  • Design a Layered Image Page Template using HTML and CSS
    The article provides a complete guide for creating a layered image layout using HTML and CSS. The Layered Image Page refers to a webpage design that contains layered structured visual elements using images. Here, the design contains two boxes with background images and some empty rounded boxes with
    3 min read
  • Email Template using HTML and CSS
    Ever been intrigued by the vibrant and engaging email templates that land in your inbox? This article will guide you through the process of creating a basic, yet visually appealing, email template using HTML and CSS. Such templates are primarily used in marketing campaigns with the ultimate goal of
    5 min read
  • Design a Overlap Block Page Template using HTML and CSS
    In this article, we will create an Overlap Block layout template using HTML & CSS. The Overlap Block Layout is a design concept where multiple elements or blocks on a webpage visually overlap with one another. This layout frequently uses CSS's z-index property to regulate the order in which item
    3 min read
  • Design a Contact us Page using HTML and CSS
    A Contact Us page is used to allow visitors to contact the website owner or administrator for various purposes, such as asking questions, giving feedback, requesting information, or reporting issues. In this article, we will see how to design a Contact Us page using HTML and CSS. Creating an attract
    4 min read
  • Design a Tribute Page using HTML and CSS
    Making a tribute page is an Innovative way to honor someone special in your life. In this article, we create a tribute webpage using HTML and CSS. This page has a simple and creative design. It contains a header with a title, a main section with text and images, and a footer for main details or cred
    4 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