039-transform-scale-rotate.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>039 transform</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. .stage { width: 320px; height: 230px; background: #f4f4f4;
  14. border: 1px solid #999999; }
  15. .imgrow { height: 130px; padding: 10px 0 0 10px; }
  16. .cell { float: left; width: 150px; }
  17. .scaled { transform: scale(0.5); transform-origin: top left; }
  18. .rotated-img { transform: rotate(90deg); transform-origin: center; }
  19. .scaled-box { width: 80px; height: 40px; margin: 10px 0 0 10px;
  20. background: #cc3333; transform: scale(1.5);
  21. transform-origin: top left; }
  22. .ref-scaled-box { width: 120px; height: 60px; margin: 10px 0 0 10px;
  23. background: #cc3333; }
  24. .caption { clear: both; color: #555555; padding-top: 3px; }
  25. </style>
  26. </head>
  27. <body>
  28. <h1>039 &middot; transform scale and rotate</h1>
  29. <p>Each pair must look identical. Transforms paint the element box and inline images; text and descendants keep their layout.</p>
  30. <div class="pane">
  31. <div class="label">A &middot; transform</div>
  32. <div class="stage">
  33. <div class="imgrow">
  34. <div class="cell"><img class="scaled" src="PIC.BMP" width="194" height="122"></div>
  35. <div class="cell"><img class="rotated-img" src="TILE.PNG" width="64" height="64"></div>
  36. </div>
  37. <div class="scaled-box"></div>
  38. </div>
  39. <div class="caption">scale(0.5), rotate(90deg), scaled box</div>
  40. </div>
  41. <div class="pane">
  42. <div class="label">B &middot; reference</div>
  43. <div class="stage">
  44. <div class="imgrow">
  45. <div class="cell"><img src="PIC.BMP" width="97"></div>
  46. <div class="cell"><img src="TILE90.PNG" width="64" height="64"></div>
  47. </div>
  48. <div class="ref-scaled-box"></div>
  49. </div>
  50. <div class="caption">97px image, pre-rotated tile, 120&times;60 box</div>
  51. </div>
  52. </body>
  53. </html>