I have been studying a media query, but the background color does not change at each breakpoint I set. I cannot find any solutions. Does anyone know how to change the background color when a user shrink the width of the browser ?
style.css
@media (min-width: 1200px) {
body {
background: orange;
color: #742f37;
font-family: "Caslon", serif;
}
}
@media (min-width: 1024px) {
body {
background: pink;
color: cornsilk;
font-family: Gills Sans Extrabold, sans-serif;
}
}
@media (min-width: 768px) {
body{
background: purple;
color: white;
font-family: "Georgia", serif;
}
}
@media (min-width: 667px) {
body {
background: cyan;
color: red;
font-family: Gills Sans, sans-serif;
}
}
@media (min-width: 375px) {
body{
background: black;
color: yellow;
font-family: Helvetica, sans-serif;
}
}
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="style.css" />
<title>Understanding the media query</title>
</head>
<body>
<h1></h1>
<p>I am a web designer. </p>
<p>I am a graphic designer.</p>
<p>I am an editorial designer.</p>
<section class="colorBoxes">
<div></div>
<div></div>
<div></div>
<div></div>
</section>
</body>
</html>