<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
background-color: yellow;
}
@media only screen and (max-width: 600px) {
body {
background-color: lightblue;
}
}
</style>
</head>
<body>
<h1>The @media Rule</h1>
<p>Resize the browser window. When the width of this document is 600 pixels or less, the background-color is "lightblue", otherwise it is "yellow".</p>
</body>
<!-- Mirrored from www.w3schools.com/cssref/tryit.asp?filename=trycss3_media_bg by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:01:20 GMT -->
</html>