line-breaking-012.html (905B)
1 <!doctype html> 2 <html> 3 <meta charset="utf-8"> 4 <title>CSS Text — line breaking for nowrap and floats</title> 5 <meta name=assert content="When whitespace: nowrap is specified, floats should not cause line breaks"> 6 <link rel=help href="https://www.w3.org/TR/css-text-3/#white-space-property"> 7 <link rel=match href="reference/line-breaking-012-ref.html"> 8 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 9 <style> 10 .container { 11 position: relative; 12 color:green; 13 line-height: 1em; 14 font-family: Ahem; 15 font-size: 20px; 16 } 17 18 .wrapper { 19 white-space: nowrap; 20 } 21 22 span { 23 float: left; 24 } 25 26 .fail { 27 color: red; 28 position: absolute; 29 left: 0; 30 top: 0; 31 z-index: -1; 32 } 33 </style> 34 <body> 35 <p>There should be a green rectangle and no red.</p> 36 <div class="container"> 37 <div class="fail">XX</div> 38 <div class="wrapper">X<span>X<span></div> 39 </div> 40 </body> 41 </html>