038-background-props.html 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>038 background properties</title>
  6. <style>
  7. html, body { margin: 0; padding: 0; background: #ffffff; color: #202020; }
  8. body { font-family: sans-serif; font-size: 13px; padding: 10px; }
  9. h1 { font-size: 20px; margin: 0 0 6px 0; }
  10. p { margin: 0 0 10px 0; }
  11. .pane { float: left; width: 440px; margin-left: 10px; }
  12. .label { background: #eeeeee; padding: 4px 6px; margin-bottom: 4px; }
  13. .row { clear: both; margin-bottom: 10px; }
  14. .tile { width: 194px; height: 128px;
  15. background: #dddddd url(TILE.PNG) repeat; background-size: 64px; }
  16. .tile-ref { width: 194px; height: 128px; background-color: #dddddd; }
  17. .tile-img { float: left; width: 64px; height: 64px; }
  18. .pos { width: 194px; height: 122px; background-color: #dddddd;
  19. background-image: url(PIC.BMP); background-size: 64px;
  20. background-position: 20px 10px; background-repeat: no-repeat; }
  21. .pos-ref { width: 194px; height: 122px; background-color: #dddddd;
  22. padding: 10px 0 0 20px; box-sizing: border-box; }
  23. .contain { width: 120px; height: 60px; background-color: #dddddd;
  24. background-image: url(PIC.BMP); background-size: contain;
  25. background-position: center; background-repeat: no-repeat; }
  26. .contain-ref { width: 120px; height: 60px; background-color: #dddddd;
  27. padding-left: 12px; box-sizing: border-box; }
  28. .cover { width: 120px; height: 120px; background-color: #dddddd;
  29. background-image: url(TILE.PNG); background-size: cover;
  30. background-repeat: no-repeat; }
  31. .caption { clear: both; color: #555555; padding-top: 2px; }
  32. </style>
  33. </head>
  34. <body>
  35. <h1>038 &middot; background repeat, position and size</h1>
  36. <p>Each pair must look identical. The tile source is 64&times;64; PIC.BMP is 194&times;122.</p>
  37. <div class="pane">
  38. <div class="label">A &middot; background properties</div>
  39. <div class="row"><div class="tile"></div>
  40. <div class="caption">background shorthand URL, repeat, size: 64px</div></div>
  41. <div class="row"><div class="pos"></div>
  42. <div class="caption">no-repeat, position: 20px 10px, size: 64px</div></div>
  43. <div class="row"><div class="contain"></div>
  44. <div class="caption">contain, centered</div></div>
  45. <div class="row"><div class="cover"></div>
  46. <div class="caption">cover in a 120&times;120 box</div></div>
  47. </div>
  48. <div class="pane">
  49. <div class="label">B &middot; reference</div>
  50. <div class="row"><div class="tile-ref">
  51. <img class="tile-img" src="TILE.PNG" width="64" height="64">
  52. <img class="tile-img" src="TILE.PNG" width="64" height="64">
  53. <img class="tile-img" src="TILE.PNG" width="64" height="64">
  54. <img class="tile-img" src="TILE.PNG" width="64" height="64">
  55. <img class="tile-img" src="TILE.PNG" width="64" height="64">
  56. <img class="tile-img" src="TILE.PNG" width="64" height="64">
  57. </div><div class="caption">six 64&times;64 images, 3 per row</div></div>
  58. <div class="row"><div class="pos-ref">
  59. <img src="PIC.BMP" width="64">
  60. </div><div class="caption">image at 20,10, width 64</div></div>
  61. <div class="row"><div class="contain-ref">
  62. <img src="PIC.BMP" width="95">
  63. </div><div class="caption">image width 95, centered</div></div>
  64. <div class="row"><div><img src="TILE.PNG" width="120" height="120"></div>
  65. <div class="caption">120&times;120 image</div></div>
  66. </div>
  67. </body>
  68. </html>