CSS21-t100303.xhtml 10 KB

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