Page Widget How to - Change background for width change








Question

We would like to know how to change background for width change.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
body {<!--from www .  j a v  a 2 s  .c  o m-->
  background: black;
}

@media screen and (max-width:700px) {
  body {
    background: red;
  }
}
</style>
</head>
<body>
</body>
</html>

The code above is rendered as follows: