Step 1. Declare the viewport meta
First you need to put this card into the folder <head> section on the HTML code of the website.
Code:
<meta name = "viewport" content = "width = device-width, initial-scale = 1">
Step 2. Write CSS to the width of the device
Code:
body {
background: #fff;
color: 333;
}
@media all and (max-width: 320px) {
body {
background: #e7e7e7;
}
}
This means your website will default (background) is white, but when scaled to the browser from 0px to 320px, then it will have a base of gray with color code # e7e7e7
Bookmarks