Table of Contents

Expandable Pure Css Product Card

Share Now :

Title : Expandable Pure Css Product Card | W3Pupil

Description

Hello W3PUPIL!!

W3pupil provides a dynamic and visually appealing product card snippet that showcases the information in a single glance. This product card snippet is created with precision using HTML and CSS.

A product card snippet displays the name of the product as well as an image at the top of the card, thereby creating a positive first impression of the product. A short description of the product can be added further down the page. This is followed by a display of the price and rating of the product. There is an add to cart option at the bottom of the page, which can be used in order to add the product to your shopping cart. CSS allows for the addition of hover effects and responsive design, making the product card snippet interactive and accessible across multiple devices. The product card is fully responsive, allowing the information to be displayed on any device, including desktops, laptops, tablets, and smartphones.

With this HTML and CSS-powered product card snippet, you’re not just sharing information – you’re making a statement about your commitment to professionalism and modern web design. Impress, engage, and connect with the world through this creative and informative product card snippet.

Let's know how to create a file..

Creating and managing files and folders efficiently is crucial for a seamless development experience. A step-by-step tutorial is provided below:

W3pupil’s suggestion is to download and install Visual Studio Code.

  • After the successful completion of downloading and installing, open Visual Studio Code.
  • Create a new folder in your desktop.
  • Go to file and then open the folder created.
  • Then add a file for html with “.html” or “.htm” extension.
  • Also add another file for css with “.css” extension.
  • Now, you have a blank HTML file and CSS file ready for your code.

Let's know how to open a downloaded file..

  • After downloading the snippet file from W3pupil, you will receive a zip file.
  • Extract the file and open it in Visual Studio Code.
  • Now you have the HTML file and CSS file to work with.
  • Take time to fully understand the code’s functionality before making any desired changes.

Let's take a look at a code snippet created by W3pupil team using HTML and CSS.

HTML SOURCE CODE LOGO

HTML Source Code

HTML (Hypertext Markup Language) is a standard markup language for creating web pages, defining their structure and content using a system of tags and elements. (index.html)

  <!--Hello Future Developer Thanks for Using w3pupil.com, Share & Support us-->
<div class="section1">
<div class="card">
    <div class="cardin1">
        <button><i class="fa-solid fa-cart-shopping"></i></button>
    </div>
    <div class="cardin2">  
        <h2>Product Name</h2>
        <p>Introducing our ergonomic office chair - a perfect blend of style and comfort, designed to enhance your workspace and productivity. Experience unparalleled support and modern elegance with every sit.</p>
        <h5>$200</h5>
        <div class="star-rating">
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
            <i class="fas fa-star-half-alt"></i>
        </div>  
    </div>
    <div class="cardin3">
        <button>Add To Cart</button>
    </div>
</div>
<div class="credit">Made with <span>❤ </span>by <a href="https://www.w3pupil.com/">W3pupil</a></div>
</div>
<!--Check our website Regularly For New Snippets Post-->  
CSS SOURCE CODE IMAGE

CSS Source Code

CSS (Cascading Style Sheet) enhances website aesthetics and layout, applying styles and design elements to create a visually appealing and responsive user interface. (style.css)

  /** 
Hello Future Developer Thanks for Using w3pupil.com, 
Check our website Regularly For New Snippets Post.

Share & Support us
**/
@import url('https://fonts.googleapis.com/css2?family=Play&display=swap');
*{
    box-sizing: border-box;
}
body{
    font-family: Arial, sans-serif;
    margin:0%;
}
.section1{
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content:center;
    align-items: center;
    background: #0052D4;
    background: -webkit-linear-gradient(to right, #6FB1FC, #4364F7, #0052D4);  
    background: linear-gradient(to right, #6FB1FC, #4364F7, #0052D4);
}
.card{
    display: flex;
    flex-direction:column;
    justify-content:space-between;
    border-radius: 20px;
    width:400px;
    height:330px;
    background-color:#fff;
    padding:20px;
    transition: width 1s ease-in-out, height 1s ease-in-out;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}
.cardin1{
    padding:10px 0;
    display: flex;
    flex-direction:column;
    align-items:end;
    border-radius: 20px;
    width:360px;
    height:300px;
    background-image: url(https://cdn.pixabay.com/photo/2014/12/15/14/00/beauty-saloon-569111_1280.jpg);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow: rgba(14, 30, 37, 0.12) 0px 2px 4px 0px, rgba(14, 30, 37, 0.32) 0px 2px 16px 0px;
}
.cardin1 button{
    border: none;
    border-radius: 50%;
    padding:10px;
    margin:0px 10px;
    font-size:16px;
}
.cardin1 button:hover{
    cursor: pointer;
    color:#121212;
    background-color: #faaca8;
}
.cardin2{
    display: flex;
    flex-direction:column;
    align-items:start;
    justify-content: center;
    padding:10px 0px; 
    flex-shrink: 0;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: opacity 1s ease-in-out, height 1s ease-in-out;
}
.card:hover{
    height:600px;
}
.card:hover .cardin2{
    height:calc(600px - 350px);
    opacity: 1;
}
.cardin2 h2{
    margin:2px 0px;
    font-family: 'Play', sans-serif;
    font-size: 20px;
    font-weight: 300;
}
.cardin2 h5{
    margin:2px 0px;
    font-size:28px;
    font-weight: 300;
}
.cardin2 .star-rating{
    font-size: 14px;
}
.cardin2 .star-rating .fas.fa-star{
  color: gold;
}
.cardin2 .star-rating .fas.fa-star-half-alt{
  color: gold; 
  border: none; 
}
.cardin3{
  height:50px;
}
.cardin3 button{
  border: none;
  border-radius:10px;
  padding:15px;
  margin:10px  0px;
  font-size:16px;
  width:100%;
  background-color: #4364F7;
  color:#fff;
  transition:.5s;
  cursor: pointer;
}
.cardin3 button:hover{
transform: scale(1.05);
}
@media only screen and (max-width: 1024px){
    .card{
        height:600px;
    }
    .cardin2{
        height:calc(600px - 350px);
        opacity:1;
    }
    .cardin1{
        width:100%;
    }
}
@media only screen and (max-width: 630px){
    .card{
        width:98%;
        height:600px;
    }
    .cardin2{
        height:calc(600px - 350px);
        opacity:1;
    }
    .cardin1{
        width:100%;
    }
}
.credit a{
    text-decoration: none;
    color: #121212;
    font-weight: 800;
}
.credit{
    color: #121212;
    text-align: center;
    margin-top: 10px;
    font-family: Verdana,Geneva,Tahoma,sans-serif;
}  

Note :

  • The CSS is coded in a separate file and linked to the HTML file.

Download :

Share and Support W3pupil.com

Conclusion :

To modify the code, you can download the snippet’s source code files. To enhance your skills in HTML and CSS, you can try to recreate other creative HTML and CSS snippets available on W3pupil. In case you experience any technical related doubts, you are welcome to contact W3pupil. We’ll try to solve your request at the earliest.

Like Reaction
Like Reaction
Like Reaction
Like Reaction
Like Reaction

LivePreview :