025-nowrap.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>025 white-space: nowrap</title>
  6. <style>
  7. html, body { margin: 0; padding: 0; background: #ffffff; color: #202020; }
  8. body { font-family: sans-serif; font-size: 13px; }
  9. h1 { font-size: 20px; margin: 10px 0 4px 10px; }
  10. p { margin: 0 0 10px 10px; }
  11. .pane { float: left; width: 440px; margin-left: 10px; }
  12. .label { background: #eeeeee; padding: 4px 6px; margin-bottom: 4px; }
  13. .stage { background: #ffffff; padding: 8px; border: 1px solid #999999; }
  14. .nowrap { width: 200px; white-space: nowrap; }
  15. .wide { width: 420px; }
  16. .after { background: #333333; color: #ffffff; height: 24px; margin-top: 8px; padding-left: 4px; }
  17. </style>
  18. </head>
  19. <body>
  20. <h1>025 &middot; white-space: nowrap</h1>
  21. <p>The sentence must stay on one line in both panes; A's line box is only 200 px wide.</p>
  22. <div class="pane">
  23. <div class="label">A: width: 200px; white-space: nowrap</div>
  24. <div class="stage">
  25. <div class="nowrap">The quick brown fox jumps over the lazy dog.</div>
  26. <div class="after">after</div>
  27. </div>
  28. </div>
  29. <div class="pane">
  30. <div class="label">B: width: 420px reference</div>
  31. <div class="stage">
  32. <div class="wide">The quick brown fox jumps over the lazy dog.</div>
  33. <div class="after">after</div>
  34. </div>
  35. </div>
  36. </body>
  37. </html>