Hello developers, today in this blog you'll learn to create a Glassmorphism Product Card Design using HTML & CSS.
A product card contains a picture or image of the product, price, and description of that product or an item. A product card is used to advertise a product to people. The glass effect had been used in this product card. The Glassmorphism is used to emphasize light or dark objects, placed on top of colorful backgrounds.
In this blog (Glassmorphism Product Card Design), there is a card at the center of the page with a product image, product price, product description, and a button to add the product to the cart.
The source code of this Glassmorphism Product Card Design is given below, if you want the source code of this program, you can copy it. You can use this Glassmorphism Product Card Design code with your creativity and can take this product card to the next level.
Glassmorphism Product Card Design [Source Code]
To make this website (Glassmorphism Product Card Design), you need to create two files: an HTML file and 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.
@import url('https://fonts.googleapis.com/css2?family=Work+Sans&display=swap');
* {
font-family: Work Sans;
margin: 0;
padding: 0;
}
body {
background: -webkit-linear-gradient(to right, #185a9d, #43cea2);
background: linear-gradient(to right, #185a9d, #43cea2);
background-size: cover;
background-position: center;
height: 100vh;
overflow: hidden;
color: #000;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
body::before {
content: '';
width: 330px;
height: 330px;
background: linear-gradient(rgba(255,255,255,0.3) 20%, rgba(255,255,255,0.2));
backdrop-filter: blur(10px);
box-shadow: 0 0 25px #666;
position: absolute;
top: -100px;
left: 100px;
border-radius: 50%;
border-top: 2px solid rgba(255,255,255,0.3);
border-left: 2px solid rgba(255,255,255,0.3);
}
body::after {
content: '';
width: 300px;
height: 300px;
background: linear-gradient(rgba(255,255,255,0.3) 20%, rgba(255,255,255,0.2));
backdrop-filter: blur(10px);
box-shadow: 0 0 25px #666;
position: absolute;
bottom: -100px;
right: 100px;
border-radius: 50%;
border-top: 2px solid rgba(255,255,255,0.3);
border-left: 2px solid rgba(255,255,255,0.3);
z-index: -1;
}
.card {
width: 350px;
padding: 20px;
background: linear-gradient(rgba(255,255,255,0.3) 20%, rgba(255,255,255,0.2));
backdrop-filter: blur(6px);
border-radius: 20px;
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
}
.card-img {
display: block;
margin: auto;
position: relative;
border-radius: 20px;
padding: 10px;
}
.name {
letter-spacing: 1px;
text-align: center;
margin-top: 35px;
transform: translateZ(20px)
}
.price {
letter-spacing: 1px;
text-align: center;
font-size: 30px;
margin-top: -5px;
padding: 10px;
}
p {
text-align: center;
padding: 10px;
}
button {
width: 90%;
display: block;
margin: auto;
height: 50px;
border: none;
outline: none;
border-radius: 8px;
text-transform: uppercase;
letter-spacing: 1px;
background: #11998e;
color: #fff;
cursor: pointer;
margin: 10px;
}
.credit a{
text-decoration: none;
font-weight: 800;
color: #000;
}
.credit {
margin: 10px;
}
Thank you for reading our blog. If you face any problem in creating this Glassmorphism Product Card Design using HTML & CSS, then contact us or comment us. We’ll try to provide a solution to your problem as soon as possible.
Post a Comment
Thank you
Learning robo team