mq_print_devicewidth.xhtml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?xml version="1.0" encoding="iso-8859-1" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" class="reftest-print">
  4. <head>
  5. <title>Media Query - Print mode test - device-width</title>
  6. <style type="text/css"><![CDATA[
  7. p {height: 10px; width: 100px; color: yellow; }
  8. @media print { .a { color: aqua; } }
  9. @media screen { .b { color: aqua; } }
  10. /* we set the width to 5 inches/360pt/127mm in the reftest-print class*/
  11. @media (device-width: 5in) { .c { color: aqua; } } /* y */
  12. @media (device-width: 360pt) { .d { color: aqua; } } /* y */
  13. @media (device-width: 127mm) { .e { color: aqua; } } /* y */
  14. @media print and (device-width: 5in) { .f {color: aqua; } } /* y */
  15. @media print and (device-width: 360pt) { .g {color: aqua; } }/* y */
  16. @media print and (device-width: 127mm) { .h {color: aqua; } }/* y */
  17. @media all and (device-width: 5in) { .i { color: aqua; } } /* y */
  18. /* negative cases */
  19. @media all and (device-width: 6in) { .j { color: aqua; } } /* n */
  20. @media (device-width: 130mm) { .k { color: aqua; } } /* n */
  21. @media (device-width: 6in) { .l { color: aqua; } } /* n */
  22. @media (device-width: 400pt) { .m { color: aqua; } } /* n */
  23. @media screen and (device-width: 5in) { .n {color: aqua; } } /* n */
  24. @media screen and (device-width: 360pt) { .o {color: aqua; } } /* n */
  25. @media screen and (device-width: 127mm) { .p {color: aqua; } } /* n */
  26. ]]></style>
  27. </head>
  28. <body>
  29. <p class="a">a</p>
  30. <p class="b">b</p>
  31. <p class="c">c</p>
  32. <p class="d">d</p>
  33. <p class="e">e</p>
  34. <p class="f">f</p>
  35. <p class="g">g</p>
  36. <p class="h">h</p>
  37. <p class="i">i</p>
  38. <p class="j">j</p>
  39. <p class="k">k</p>
  40. <p class="l">l</p>
  41. <p class="m">m</p>
  42. <p class="n">n</p>
  43. <p class="o">o</p>
  44. <p class="p">p</p>
  45. </body>
  46. </html>