Change background in media queries - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Media

Description

Change background in media queries

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
div {<!--from   ww  w  .j a  v a  2s.  c  o  m-->
   background:black;
   color:Chartreuse;
}

@media only screen and (max-width: 450px){
   div {
   background:green;
}
</style> 
 </head> 
 <body> 
  <div>
    Lorem ips 
  </div>  
 </body>
</html>

Related Tutorials