0

Resize the browser window. When the width of this document is 700 pixels or less, the background-color is "green"

<style>
body {
  background-color: yellow;
}
 @media only screen and (max-width: 700px) {
  body {
    background-color: green;
  }
}
</style>
</head>
<body>
 <p>Resize the browser window. When the width of this document is 700 pixels or less, the background-color is "green", otherwise it is "yellow".</p>

"

How to use Media Query in CSS and HTML?
Working Code Edited question December 5, 2023