Responsive media query, change background color - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

Responsive media query, change background color

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
  <style>
body {<!--from ww w  .j  a  v  a  2 s  .  co m-->
   background:green;
}

@media only screen and (max-width: 500px)  {
   body {
      background:yellow;
   }

}
</style> 
 </head> 
 <body>  
 </body>
</html>

Related Tutorials