CSS21-t100303-simple.xhtml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>CSS 2.1 Test Suite: Block-level, non-replaced elements in normal flow</title>
  5. <!--
  6. THIS IS NOT THE FULL TEST. IT HAS BEEN MODIFIED TO WORK
  7. AROUND THE FOLLOWING BUG:
  8. https://bugzilla.mozilla.org/show_bug.cgi?id=423306
  9. BY MAKING THE INTERMEDIATE ELEMENT NOT HAVE CHANGING 'direction'
  10. -->
  11. <link rel="author" title="L. David Baron" href="https://dbaron.org/" />
  12. <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
  13. <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#blockwidth" />
  14. <meta name="flags" content="" />
  15. <style type="text/css"><![CDATA[
  16. body { direction: ltr; }
  17. div { height: 1px; }
  18. /* containing block */
  19. body > div {
  20. margin: 0 17px 0 3px;
  21. border: medium solid transparent;
  22. border-width: 0 154px 0 157px;
  23. padding: 0 6px 0 2px;
  24. width: 350px;
  25. }
  26. /* parent that is not containing block */
  27. /* COMMENTED OUT PER WORKAROUND DESCRIBED AT TOP */
  28. /* body > div > div { display: inline; } */
  29. /* test element */
  30. body > div > div > div {
  31. margin: 0 10px 0 6px;
  32. border: medium solid transparent;
  33. border-width: 0 12px 0 5px;
  34. padding: 0 17px 0 9px;
  35. }
  36. /* COMMENTED OUT PER WORKAROUND DESCRIBED AT TOP */
  37. body > div, /* body > div > div, */ body > div > div > div { direction: ltr; }
  38. body > div.trtl > div > div { direction: rtl; }
  39. /* COMMENTED OUT PER WORKAROUND DESCRIBED AT TOP */
  40. /* body > div.prtl > div { direction: rtl; } */
  41. body > div.cbrtl { direction: rtl; }
  42. body > div.mlauto > div > div { margin-left: auto; }
  43. body > div.mrauto > div > div { margin-right: auto; }
  44. body > div.wauto > div > div { width: auto; }
  45. body > div.wnarrow > div > div { width: 127px; }
  46. body > div.wwide > div > div { width: 415px; }
  47. /*
  48. * make a background on the containing block that is red
  49. * everywhere except where the test should draw its background
  50. */
  51. body > div.wnarrow { background-image: url(CSS21-t100303-green-outside-170px.png); }
  52. body > div.wwide { background-image: url(CSS21-t100303-green-outside-458px.png); }
  53. body > div.wauto { background-image: url(CSS21-t100303-green-outside-334px.png); }
  54. body > div.wauto.mlauto { background-image: url(CSS21-t100303-green-outside-340px.png); }
  55. body > div.wauto.mrauto { background-image: url(CSS21-t100303-green-outside-344px.png); }
  56. body > div.wauto.mlauto.mrauto { background-image: url(CSS21-t100303-green-outside-350px.png); }
  57. /*
  58. * The only results in the markup rather than using selectors
  59. * are whether the div ends up aligned to the left edge (atl),
  60. * the right edge (atr), or centered (atc). Things with auto
  61. * widths always count as atl, to make the style rules simpler
  62. * (though they abut both edges).
  63. */
  64. body > div.atl { background-position: 8px 0; }
  65. body > div.atl.mlauto { background-position: 2px 0; }
  66. body > div.atr.wnarrow { background-position: 172px 0; }
  67. body > div.atr.wnarrow.mrauto { background-position: 182px 0; }
  68. body > div.atr.wwide { background-position: -116px 0; }
  69. body > div.atr.wwide.mrauto { background-position: -106px 0; }
  70. /* Can only be atc when mlauto and mrauto and wnarrow. */
  71. body > div.atc.wnarrow { background-position: 92px 0; }
  72. /*
  73. * make a background on the test div that is green only within
  74. * its desired width and red elsewhere
  75. */
  76. body > div.wnarrow > div > div { background-image: url(CSS21-t100303-green-in-170px.png); }
  77. body > div.wwide > div > div { background-image: url(CSS21-t100303-green-in-458px.png); }
  78. body > div.wauto > div > div { background-image: url(CSS21-t100303-green-in-334px.png); }
  79. body > div.wauto.mlauto > div > div { background-image: url(CSS21-t100303-green-in-340px.png); }
  80. body > div.wauto.mrauto > div > div { background-image: url(CSS21-t100303-green-in-344px.png); }
  81. body > div.wauto.mlauto.mrauto > div > div { background-image: url(CSS21-t100303-green-in-350px.png); }
  82. /* move position to border-edge */
  83. body > div > div > div { background-position: -5px 0; }
  84. /* for debugging */
  85. /* body > div { background: transparent ! important; } */
  86. /* body > div > div > div { background: orange ! important; } */
  87. ]]></style>
  88. </head>
  89. <body>
  90. <div class="atl wauto"><div><div></div></div></div>
  91. <div class="atl wauto trtl"><div><div></div></div></div>
  92. <div class="atl wauto prtl"><div><div></div></div></div>
  93. <div class="atl wauto prtl trtl"><div><div></div></div></div>
  94. <div class="atl wauto cbrtl"><div><div></div></div></div>
  95. <div class="atl wauto cbrtl trtl"><div><div></div></div></div>
  96. <div class="atl wauto cbrtl prtl"><div><div></div></div></div>
  97. <div class="atl wauto cbrtl prtl trtl"><div><div></div></div></div>
  98. <div class="atl wauto mlauto"><div><div></div></div></div>
  99. <div class="atl wauto mlauto trtl"><div><div></div></div></div>
  100. <div class="atl wauto mlauto prtl"><div><div></div></div></div>
  101. <div class="atl wauto mlauto prtl trtl"><div><div></div></div></div>
  102. <div class="atl wauto mlauto cbrtl"><div><div></div></div></div>
  103. <div class="atl wauto mlauto cbrtl trtl"><div><div></div></div></div>
  104. <div class="atl wauto mlauto cbrtl prtl"><div><div></div></div></div>
  105. <div class="atl wauto mlauto cbrtl prtl trtl"><div><div></div></div></div>
  106. <div class="atl wauto mrauto"><div><div></div></div></div>
  107. <div class="atl wauto mrauto trtl"><div><div></div></div></div>
  108. <div class="atl wauto mrauto prtl"><div><div></div></div></div>
  109. <div class="atl wauto mrauto prtl trtl"><div><div></div></div></div>
  110. <div class="atl wauto mrauto cbrtl"><div><div></div></div></div>
  111. <div class="atl wauto mrauto cbrtl trtl"><div><div></div></div></div>
  112. <div class="atl wauto mrauto cbrtl prtl"><div><div></div></div></div>
  113. <div class="atl wauto mrauto cbrtl prtl trtl"><div><div></div></div></div>
  114. <div class="atl wauto mrauto mlauto"><div><div></div></div></div>
  115. <div class="atl wauto mrauto mlauto trtl"><div><div></div></div></div>
  116. <div class="atl wauto mrauto mlauto prtl"><div><div></div></div></div>
  117. <div class="atl wauto mrauto mlauto prtl trtl"><div><div></div></div></div>
  118. <div class="atl wauto mrauto mlauto cbrtl"><div><div></div></div></div>
  119. <div class="atl wauto mrauto mlauto cbrtl trtl"><div><div></div></div></div>
  120. <div class="atl wauto mrauto mlauto cbrtl prtl"><div><div></div></div></div>
  121. <div class="atl wauto mrauto mlauto cbrtl prtl trtl"><div><div></div></div></div>
  122. <div class="atl wnarrow"><div><div></div></div></div>
  123. <div class="atl wnarrow trtl"><div><div></div></div></div>
  124. <div class="atl wnarrow prtl"><div><div></div></div></div>
  125. <div class="atl wnarrow prtl trtl"><div><div></div></div></div>
  126. <div class="atr wnarrow cbrtl"><div><div></div></div></div>
  127. <div class="atr wnarrow cbrtl trtl"><div><div></div></div></div>
  128. <div class="atr wnarrow cbrtl prtl"><div><div></div></div></div>
  129. <div class="atr wnarrow cbrtl prtl trtl"><div><div></div></div></div>
  130. <div class="atr wnarrow mlauto"><div><div></div></div></div>
  131. <div class="atr wnarrow mlauto trtl"><div><div></div></div></div>
  132. <div class="atr wnarrow mlauto prtl"><div><div></div></div></div>
  133. <div class="atr wnarrow mlauto prtl trtl"><div><div></div></div></div>
  134. <div class="atr wnarrow mlauto cbrtl"><div><div></div></div></div>
  135. <div class="atr wnarrow mlauto cbrtl trtl"><div><div></div></div></div>
  136. <div class="atr wnarrow mlauto cbrtl prtl"><div><div></div></div></div>
  137. <div class="atr wnarrow mlauto cbrtl prtl trtl"><div><div></div></div></div>
  138. <div class="atl wnarrow mrauto"><div><div></div></div></div>
  139. <div class="atl wnarrow mrauto trtl"><div><div></div></div></div>
  140. <div class="atl wnarrow mrauto prtl"><div><div></div></div></div>
  141. <div class="atl wnarrow mrauto prtl trtl"><div><div></div></div></div>
  142. <div class="atl wnarrow mrauto cbrtl"><div><div></div></div></div>
  143. <div class="atl wnarrow mrauto cbrtl trtl"><div><div></div></div></div>
  144. <div class="atl wnarrow mrauto cbrtl prtl"><div><div></div></div></div>
  145. <div class="atl wnarrow mrauto cbrtl prtl trtl"><div><div></div></div></div>
  146. <div class="atc wnarrow mrauto mlauto"><div><div></div></div></div>
  147. <div class="atc wnarrow mrauto mlauto trtl"><div><div></div></div></div>
  148. <div class="atc wnarrow mrauto mlauto prtl"><div><div></div></div></div>
  149. <div class="atc wnarrow mrauto mlauto prtl trtl"><div><div></div></div></div>
  150. <div class="atc wnarrow mrauto mlauto cbrtl"><div><div></div></div></div>
  151. <div class="atc wnarrow mrauto mlauto cbrtl trtl"><div><div></div></div></div>
  152. <div class="atc wnarrow mrauto mlauto cbrtl prtl"><div><div></div></div></div>
  153. <div class="atc wnarrow mrauto mlauto cbrtl prtl trtl"><div><div></div></div></div>
  154. <div class="atl wwide"><div><div></div></div></div>
  155. <div class="atl wwide trtl"><div><div></div></div></div>
  156. <div class="atl wwide prtl"><div><div></div></div></div>
  157. <div class="atl wwide prtl trtl"><div><div></div></div></div>
  158. <div class="atr wwide cbrtl"><div><div></div></div></div>
  159. <div class="atr wwide cbrtl trtl"><div><div></div></div></div>
  160. <div class="atr wwide cbrtl prtl"><div><div></div></div></div>
  161. <div class="atr wwide cbrtl prtl trtl"><div><div></div></div></div>
  162. <div class="atl wwide mlauto"><div><div></div></div></div>
  163. <div class="atl wwide mlauto trtl"><div><div></div></div></div>
  164. <div class="atl wwide mlauto prtl"><div><div></div></div></div>
  165. <div class="atl wwide mlauto prtl trtl"><div><div></div></div></div>
  166. <div class="atr wwide mlauto cbrtl"><div><div></div></div></div>
  167. <div class="atr wwide mlauto cbrtl trtl"><div><div></div></div></div>
  168. <div class="atr wwide mlauto cbrtl prtl"><div><div></div></div></div>
  169. <div class="atr wwide mlauto cbrtl prtl trtl"><div><div></div></div></div>
  170. <div class="atl wwide mrauto"><div><div></div></div></div>
  171. <div class="atl wwide mrauto trtl"><div><div></div></div></div>
  172. <div class="atl wwide mrauto prtl"><div><div></div></div></div>
  173. <div class="atl wwide mrauto prtl trtl"><div><div></div></div></div>
  174. <div class="atr wwide mrauto cbrtl"><div><div></div></div></div>
  175. <div class="atr wwide mrauto cbrtl trtl"><div><div></div></div></div>
  176. <div class="atr wwide mrauto cbrtl prtl"><div><div></div></div></div>
  177. <div class="atr wwide mrauto cbrtl prtl trtl"><div><div></div></div></div>
  178. <div class="atl wwide mrauto mlauto"><div><div></div></div></div>
  179. <div class="atl wwide mrauto mlauto trtl"><div><div></div></div></div>
  180. <div class="atl wwide mrauto mlauto prtl"><div><div></div></div></div>
  181. <div class="atl wwide mrauto mlauto prtl trtl"><div><div></div></div></div>
  182. <div class="atr wwide mrauto mlauto cbrtl"><div><div></div></div></div>
  183. <div class="atr wwide mrauto mlauto cbrtl trtl"><div><div></div></div></div>
  184. <div class="atr wwide mrauto mlauto cbrtl prtl"><div><div></div></div></div>
  185. <div class="atr wwide mrauto mlauto cbrtl prtl trtl"><div><div></div></div></div>
  186. </body>
  187. </html>