Use case: make our product gallery responsive
In this use case, we will take an e-commerce application that renders OK on a desktop but not OK on a mobile device, and fix the issue.
First, here’s the HTML code for it. If you want to follow along, you can save the following code in a products.html
file:
<html>
<head>
<title>menu</title>
<link rel="stylesheet" href="css/style.css">
<style>
/* container, grid, left col is menu, right col is main area */
.container {
max-width: 1200px;
margin: 0 auto;
display: grid;
/* 2 columns */
grid-template-columns: 200px 1fr;
background-color: #000;
padding: 10px;
/* space 5 px between columns */
grid-gap: 10px;
/* height 100% */
height: 100%;
}
/* menu items */
.menu {
/* background...