<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="index.css">
</head>
<body>
<div class="container">
<div class="item item1">
<div class="img"></div>
<div class="TITLE"><h3>CAKE</h3></div>
<div class="price">$3</div>
<div class="buy">BUY</div>
</div>
<div class="item item2">
<div class="img"></div>
<div class="TITLE"><h3>BURGER</h3></div>
<div class="price">$2</div>
<div class="buy">BUY</div>
</div><div class="item item3">
<div class="img"></div>
<div class="TITLE"><h3>SHAKE</h3></div>
<div class="price">$6</div>
<div class="buy">BUY</div>
</div><div class="item item4">
<div class="img"></div>
<div class="TITLE"><h3>ICE CREAM</h3></div>
<div class="price">$5</div>
<div class="buy">BUY</div>
</div>
</div>
</body>
</html>
*{
margin: 0;
padding: 0;
}
.container{
display:flex;
justify-content:center;
align-items:center;
height:100vh;
width:100vw;
flex-wrap:wrap;
}
.item{
height:270px;
width:200px;
background-color:red;
margin: 20px;
border-radius: 10px;
}
.img{
width:200px;
height:200px;
border-radius: 10px 10px 0px 0px ;
}
.item1 .img{
background-image:url("cake.jpg");
background-size: cover;
}
.item2 .img{
background-image:url("burger.jpg");
background-size: cover;
}
.item3 .img{
background-image:url("shake.jpg");
background-size: cover;
}
.item4 .img{
background-image: url("icecream.jpg");
background-size: cover;
}
.TITLE{
background-color:aqua;
height:20px;
width:200px;
text-align:center;
}
.price{
background-color:sandybrown;
height:20px;
width:200px;
}
.buy{
background-color: yellow;
width:fit-content;
text-align: center;
margin: 0px auto;
padding:6px 15px;
}
.item:hover{
transform:scale(1.1);
transition-duration: 0.5s;
box-shadow: 7px 10px rgba(0,0,0,0.2);
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.