8
0

1.html 507 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <div class="wrapper">
  2. <div class="limiter">
  3. <div class="target"></div>
  4. </div>
  5. <div class="source"></div>
  6. </div>
  7. <style>
  8. .wrapper {
  9. overflow: scroll;
  10. outline: 1px solid #000;
  11. height: 400px;
  12. position: relative;
  13. padding: 20px;
  14. margin-top: 100px;
  15. }
  16. .limiter {
  17. height: 500px;
  18. overflow: hidden;
  19. }
  20. .target {
  21. height: 150px;
  22. background: #ccc;
  23. width: 50px;
  24. margin: 170px auto 0;
  25. }
  26. .source {
  27. height: 50px;
  28. width: 50px;
  29. background: red;
  30. position: absolute;
  31. }
  32. </style>