Shopping Card using HTML and CSS















Hello Developers, Learning Robo offers a dynamic and visually appealing product card snippet that presents the information at a glance. This product card snippet was precisely created using HTML and CSS. A product card snippet shows the name of the product and an image at the top of the card, giving a positive first impression of the product. You can also add a product description at the bottom of the page. The price and rating of the product are then displayed. At the bottom of the page is the "Add to cart" option, which can be used to add the product to the shopping cart. CSS allows 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, so the information can be viewed on any device, including desktops, laptops, tablets and smartphones. With this HTML and CSS-powered product card snippet, you're not only sharing information, but also 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. Note: CSS is located in a separate file attached to the HTML file.

How to make Shopping Card using HTML and CSS.[Source Code]

To make this website, you would like to make two files: an HTML file, a CSS file. First, create an HTML file with the name of index.html and remember, you have to create a file with a .html extension.

<!DOCTYPE html> <html> <head> <title>Product Card UI design - learningrobo</title> <meta name="description" content="Product Card UI design - learningrobo"> <meta name="author" content="learningrobo.com"> <meta name="keywords" content="product card,responsive,learningrobo.com,html & css projects,project"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="icon" type=image/x-icon href="#"> <link rel="stylesheet" href="style.css"> <meta charset="UTF-8"> <script src="https://kit.fontawesome.com/5d72166fb5.js" crossorigin="anonymous"></script> </head> <body> <!--Hello Future Developer Thanks for Using learningrobo.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 style="color:tomato;font-size:20px;">❤ </span>by <a href="https://www.learningrobo.com/">Learningrobo</a></div> </div> <!--Check our website Regularly For New Snippets Post--> </body> </html>
CSS provides style to an HTML page. To make the page attractive create a CSS file with the name style.css and remember that you have to make a file with a .css extension.


/** 
Hello Future Developer Thanks for Using learningrobo.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;
}
We hope you would like this Shopping Card using HTML and CSS.

Thank you for reading our blog. If you face any problem in Creating a Shopping Card using HTML and CSS., then contact us or comment to us. We’ll try to provide a solution to your problem as soon as possible.

Press The Key ' p ' and say ' read article ' our voice assistant read our article.
In Our older post it doesnot work we working on that.

Thank you
Learning robo team

إرسال تعليق

Thank you
Learning robo team

Post a Comment (0)

أحدث أقدم
Learning Robo says...
code copied
Welcome