white-space-applies-to-text-001-ref.html (2604B)
1 <!DOCTYPE html> 2 3 <meta charset="UTF-8"> 4 5 <title>CSS Reference Test</title> 6 7 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> 8 9 <style> 10 section 11 { 12 border: black solid 2px; 13 float: left; 14 font-family: monospace; 15 font-size: 14px; 16 line-height: 1; /* computes to 14px */ 17 margin-bottom: 10px; 18 width: 16ch; 19 } 20 21 section.odds 22 { 23 clear: both; 24 } 25 26 section.even 27 { 28 margin-left: 10em; 29 } 30 31 div.first-subtest 32 { 33 white-space: normal; 34 } 35 36 div.second-subtest 37 { 38 white-space: nowrap; 39 } 40 41 div.third-subtest 42 { 43 white-space: pre; 44 } 45 46 div.fourth-subtest 47 { 48 white-space: pre-wrap; 49 } 50 51 div.fifth-subtest 52 { 53 white-space: break-spaces; 54 } 55 56 div.sixth-subtest 57 { 58 white-space: pre-line; 59 } 60 61 hr 62 { 63 clear: both; 64 margin: 4em auto 1.5em 0em; 65 width: 480px; 66 } 67 </style> 68 69 <p>Test passes if the characters inside of each black bordered rectangles on the lefthand side are laid out identically to their counterparts on the righthand side. 70 71 <section class="odds"> 72 <div class="first-subtest">Lorem ipsum. Dolor
 73 sit.</div> 74 </section> 75 76 <section class="even"> 77 <div class="first-subtest">Lorem ipsum. Dolor
 78 sit.</div> 79 </section> 80 81 <hr> 82 83 <section class="odds"> 84 <div class="second-subtest">Lorem ipsum. Dolor
 85 sit.</div> 86 </section> 87 88 <section class="even"> 89 <div class="second-subtest">Lorem ipsum. Dolor
 90 sit.</div> 91 </section> 92 93 <hr> 94 95 <section class="odds"> 96 <div class="third-subtest">Lorem ipsum. Dolor
 97 sit.</div> 98 </section> 99 100 <section class="even"> 101 <div class="third-subtest">Lorem ipsum. Dolor
 102 sit.</div> 103 </section> 104 105 <hr> 106 107 <section class="odds"> 108 <div class="fourth-subtest">Lorem ipsum. Dolor
 109 sit.</div> 110 </section> 111 112 <section class="even"> 113 <div class="fourth-subtest">Lorem ipsum. Dolor
 114 sit.</div> 115 </section> 116 117 <hr> 118 119 <section class="odds"> 120 <div class="fifth-subtest">Lorem ipsum. Dolor
 121 sit.</div> 122 </section> 123 124 <section class="even"> 125 <div class="fifth-subtest">Lorem ipsum. Dolor
 126 sit.</div> 127 </section> 128 129 <hr> 130 131 <section class="odds"> 132 <div class="sixth-subtest">Lorem ipsum. Dolor
 133 sit.</div> 134 </section> 135 136 <section class="even"> 137 <div class="sixth-subtest">Lorem ipsum. Dolor
 138 sit.</div> 139 </section>