css3, media queries cheatSheet

54

<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
    <title>test</title>
    <style type="text/css">
      h3 {
        text-align: center;
      }

      /* PRINT VERSION */
      @media print {
        h3:after {
          content: ' - PRINT';
          display: inline;
        }
      }
      /* PHONE VERSION */
      @media only screen and (min-width: 320px) {
        h3:after {
          content: ' - PHONE';
          display: inline;
        }
      }
      /* TABLET VERSION */
      @media only screen and (min-width: 768px) {
        h3:after {
          content: ' - TABLET';
          display: inline;
        }
      }
      /* DESKTOP VERSION */
      @media only screen and (min-width: 980px) {
        h3:after {
          content: ' - DESKTOP';
          display: inline;
        }
      }
    </style>
  </head>
  <body>
    <h3>TEST</h3>
  </body>
</html>

Comments

Submit
0 Comments