044-overflow-hidden.html 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>044 overflow hidden</title>
  6. <style>
  7. html, body { margin: 0; padding: 0; background: #ffffff; color: #202020; }
  8. body { font-family: sans-serif; font-size: 13px; padding: 10px; }
  9. h1 { font-size: 20px; margin: 0 0 6px 0; }
  10. p { margin: 0 0 10px 0; }
  11. .pane { float: left; width: 440px; margin-left: 10px; }
  12. .label { background: #eeeeee; padding: 4px 6px; margin-bottom: 4px; }
  13. .stage { width: 200px; height: 100px; overflow: hidden;
  14. background: #eeeeee; border: 1px solid #999999; }
  15. .big { position: relative; left: 30px; top: 30px; width: 300px;
  16. height: 200px; background: #cc3333; }
  17. .small { position: relative; left: 30px; top: 30px; width: 170px;
  18. height: 70px; background: #cc3333; }
  19. </style>
  20. </head>
  21. <body>
  22. <h1>044 &middot; overflow: hidden</h1>
  23. <p>The large red child must be clipped to the visible 170&times;70 rectangle in both panes.</p>
  24. <div class="pane">
  25. <div class="label">A &middot; overflow: hidden</div>
  26. <div class="stage"><div class="big"></div></div>
  27. </div>
  28. <div class="pane">
  29. <div class="label">B &middot; clipped reference</div>
  30. <div class="stage"><div class="small"></div></div>
  31. </div>
  32. </body>
  33. </html>