html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!--Image credits to Pexels-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Responsive Food Cards</title>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap" rel="stylesheet">
</head>
<body>
<div class="menu">
<div class="heading">
<h1>ROCCO'S BISTRO</h1>
<h3>- MENU -</h3>
</div>
<div class="food-items">
<img src="https://dl.dropbox.com/s/da8arutjgtwnavj/burger-compress.jpg?raw=1" alt="Burger">
<div class="details">
<div class="details-sub">
<h5>Smoky Hamburger</h5>
<h5 class="price">$8</h5>
</div>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
<button>Add To Cart</button>
</div>
</div>
<div class="food-items">
<img src="https://dl.dropbox.com/s/3fgh8xbjt21uymp/pexels_harry_dona_23_LIj2k.jpg?raw=1" alt="chicken">
<div class="details">
<div class="details-sub">
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
*{
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
}
body{
background-color: #f3f3f3;
font-family: 'Poppins',sans-serif;
}
.menu{
padding: 0 10px 30px 10px;
display: -ms-grid;
display: grid;
grid-template-columns: repeat(auto-fit,minmax(320px,1fr)) ;
grid-gap: 30px 40px;
}
.heading{
background-color: #CB202D;
color: white;
margin-bottom: 30px;
padding: 30px 0;
grid-column: 1 / -1;
text-align: center;
}
.heading>h1{
font-weight: 400;
font-size: 30px;
js
js
1
alert("Wait a few seconds for images to load");
BROWSER
Console
Run