replaced_elements.rml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <rml>
  2. <head>
  3. <title>Replaced elements</title>
  4. <link type="text/rcss" href="../style.rcss"/>
  5. <link rel="help" href="https://www.w3.org/TR/2011/REC-CSS2-20110607/visudet.html#inline-replaced-width" />
  6. <meta name="Description" content="Sizing of replaced elements." />
  7. <style>
  8. @spritesheet theme
  9. {
  10. src: /assets/invader.tga;
  11. invader: 179px 152px 50px 40px;
  12. bar: 108px 308px 70px 20px;
  13. }
  14. img {
  15. vertical-align: bottom;
  16. margin: 10dp 5dp;
  17. }
  18. .border-box {
  19. box-sizing: border-box;
  20. }
  21. input.text {
  22. font-size: 1.1em;
  23. border: 5dp #999;
  24. padding: 15dp;
  25. box-sizing: border-box;
  26. }
  27. </style>
  28. </head>
  29. <body>
  30. <p>The following images should be the same size (width and height) in each section.</p>
  31. <div>
  32. <!-- Test replaced element scaling with intrinsic ratio. -->
  33. <img style="padding: 10dp;" sprite="invader"/>
  34. <img style="padding: 10dp;" class="border-box" sprite="invader"/>
  35. <img style="padding: 10dp; height: 40dp;" sprite="invader"/>
  36. <img style="padding: 10dp; width: 50dp;" sprite="invader"/>
  37. <img style="padding: 10dp; height: 60dp;" class="border-box" sprite="invader"/>
  38. <img style="padding: 10dp; width: 70dp;" class="border-box" sprite="invader"/>
  39. <hr/>
  40. <!-- Test width and height auto sizing with constraints. -->
  41. <img style="padding: 10dp; max-height: 20dp;" sprite="invader"/>
  42. <img style="padding: 10dp; max-width: 25dp;" sprite="invader"/>
  43. <img style="padding: 10dp; max-width: 25dp; max-height: 40dp;" sprite="invader"/>
  44. <img style="padding: 10dp; max-height: 20dp; max-width: 50dp;" sprite="invader"/>
  45. <img style="padding: 10dp; max-width: 40dp; max-height: 20dp;" sprite="invader"/>
  46. <img style="padding: 10dp; max-width: 25dp; max-height: 35dp;" sprite="invader"/>
  47. <hr/>
  48. <img style="padding: 10dp; min-height: 24dp;" sprite="bar"/>
  49. <img style="padding: 10dp; min-width: 84dp;" sprite="bar"/>
  50. <img style="padding: 10dp; min-width: 84dp; min-height: 20dp;" sprite="bar"/>
  51. <img style="padding: 10dp; min-height: 24dp; min-width: 20dp;" sprite="bar"/>
  52. </div>
  53. <hr/>
  54. <p>There should be three evenly spaced, same-sized images on a single line.</p>
  55. <div style="text-align: center">
  56. <img style="float: left" sprite="invader"/>
  57. <img style="float: right" sprite="invader"/>
  58. <img sprite="invader"/>
  59. </div>
  60. <hr/>
  61. <p>The outer border of the images should take up the same height.</p>
  62. <div>
  63. <img style="border: 10dp black; height: 30dp;" sprite="invader"/>
  64. <img style="border: 2dp black; height: 50dp;" class="border-box" sprite="invader"/>
  65. <img style="border: 2dp black; padding: 5dp; height: 50dp;" class="border-box" sprite="invader"/>
  66. </div>
  67. <hr/>
  68. <p>The two images should be same-sized, and perfectly aligned below each other.</p>
  69. <div style="text-align: center;">
  70. <img style="display: block; margin: 10dp auto;" sprite="invader"/>
  71. <img style="display: inline;" sprite="invader"/>
  72. </div>
  73. <hr/>
  74. <p>The two text boxes should have the same height and fit on a single line.</p>
  75. <input style="width: 30%;" type="text" value="hello"/><input style="width: 70%;" type="text" value="world"/>
  76. </body>
  77. </rml>