Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <style> body { background-color: lightgreen; } @media screen and (max-width: 300px) { body { background-color: lightblue; } } </style> </head> <body> <p>Resize the browserwindow. When the width of this document is less than 300 pixels, the background-color is "lightblue", otherwise it is "lightgreen".</p> </body> <!-- Mirrored from www.w3schools.com/cssref/tryit.asp?filename=trycss3_media_example1 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 07:52:42 GMT --> </html>
Result:
Try it Yourself - © w3schools.com