image_ratio.rml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <rml>
  2. <head>
  3. <title>Image Ratio Sizing - Attribute</title>
  4. <link type="text/rcss" href="../style.rcss"/>
  5. <meta name="Description" content="When a width or height is set the image should be scaled keeping its aspect ratio. All but the last example should be a square." />
  6. <style>
  7. .width-50 { width: 50px; }
  8. .height-50 { height: 50px; }
  9. .height-100 { height: 100px; }
  10. </style>
  11. </head>
  12. <body>
  13. <table>
  14. <tr><td>Attribute</td><td>CSS</td></tr>
  15. <tr><td colspan="2">Original size (square 100x100):</td></tr>
  16. <tr>
  17. <td colspan="2"><img src="/assets/present.tga" alt="no width/height set" /></td>
  18. </tr>
  19. <tr><td colspan="2">Set height to 50, width auto, expect half sized square:</td></tr>
  20. <tr>
  21. <td><img src="/assets/present.tga" height="50" alt="height 50 only, attribute" /></td>
  22. <td><img src="/assets/present.tga" class="height-50" /></td>
  23. </tr>
  24. <tr><td colspan="2">Set width to 50, height auto, expect half sized square:</td></tr>
  25. <tr>
  26. <td><img src="/assets/present.tga" width="50" alt="width 50 only, attribute" /></td>
  27. <td><img src="/assets/present.tga" class="width-50" /></td>
  28. </tr>
  29. <tr><td colspan="2">Set width to 50 and height to 100 (via attributes), expect rectangular:</td></tr>
  30. <tr>
  31. <td><img src="/assets/present.tga" width="50" height="100" alt="height 100, width 50, attribute" /></td>
  32. <td><img src="/assets/present.tga" class="height-100 width-50" /></td>
  33. </tr>
  34. </table>
  35. </body>
  36. </rml>