008-media.html 931 B

123456789101112131415
  1. <!doctype html>
  2. <html><head><meta charset="utf-8"><title>008 media queries</title>
  3. <style>
  4. html,body{margin:0;padding:0;background:#fff;color:#202020;font-family:sans-serif;font-size:13px}
  5. h1{font-size:20px;margin:10px 0 4px 10px}p{margin:0 0 10px 10px}
  6. .pane{float:left;width:440px;margin-left:10px}.label{background:#eee;padding:4px 6px;margin-bottom:4px}
  7. .stage{background:#fff;padding:8px;border:1px solid #999}
  8. .box{height:80px;background:#2244cc}
  9. @media (min-width: 800px) { .box { background: #cc3333; } }
  10. </style></head><body>
  11. <h1>008 &middot; @media</h1>
  12. <p>On the normal 960+ px browser canvas the box must be red; below 800 px it is blue.</p>
  13. <div class="pane"><div class="label">A: @media (min-width: 800px)</div><div class="stage"><div class="box"></div></div></div>
  14. <div class="pane"><div class="label">B: no media</div><div class="stage"><div class="box" style="background:#cc3333"></div></div></div>
  15. </body></html>