Advertisement
1xptolevitico69

Resizable background color

Jul 11th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.81 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang=en>
  3. <head>
  4. <title>Resizable background color</title>
  5. <meta charset=utf-8>
  6. <meta name="viewport" content="width=device-width">
  7. <style>
  8.  
  9. h1{display:none;}
  10. @media all and (max-width:600px){
  11.   body{background-color:red;  }
  12. }
  13. @media all and (min-width:600px) and (max-width:900px){
  14.   body{background-color:green;  }
  15. }
  16. @media all and (min-width:900px) and (max-width:1200px){
  17.   body{background-color:blue;  }
  18. }
  19. @media all and (min-width:1200px) and (max-width:1350px){
  20.   body{background-color:black;  }
  21. }
  22. @media all and (min-width:1350px){
  23.   body{background-color:white;  }
  24. h1{display:block;width:200px;margin:200px auto;text-align:center;
  25.         }
  26. }
  27.  
  28. </style>
  29. </head>
  30. <body>
  31.  
  32.   <div><h1>White is the background default color for this page</h1></div>
  33.  
  34.  
  35. </body>
  36. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement