Advertisement
Varun_Krishna

Mediaqueries for allignment

Apr 15th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.64 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <title>Media queries demo</title>
  5.     </head>
  6.     <body>
  7.         <div class="colorDiv"> A sample text</div>
  8.         <style>
  9.             @media screen and (min-width:320px) {
  10.                 .colorDiv {
  11.                     background-color:yellow;
  12.                     color:white;
  13.                 }
  14.             }
  15.             @media screen and(min-width:480px){
  16.                 .colorDiv {
  17.                     background-color:blue;
  18.                     color:white;
  19.                 }
  20.             }
  21.             @media screen and(min-width:1025px){
  22.                 .colorDiv {
  23.                     background-color:green;
  24.                     color:white;
  25.                 }
  26.             }
  27.  
  28.             @media screen and(min-width:1281px){
  29.                 .colorDiv {
  30.                     background-color:red;
  31.                     color:white;
  32.                 }
  33.             }
  34.         </style>
  35.     </body>
  36. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement