overflow-hidden-2.html 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <link rel="match" href="reference/overflow-hidden-2-ref.html" />
  5. <style>
  6. .box1 {
  7. width: 400px;
  8. height: 400px;
  9. background-color: slateblue;
  10. position: absolute;
  11. overflow: hidden;
  12. }
  13. .translate {
  14. width: 200px;
  15. height: 200px;
  16. background-color: black;
  17. transform: translate(150px, 150px);
  18. }
  19. .box2 {
  20. width: 100px;
  21. height: 100px;
  22. background-color: orangered;
  23. position: absolute;
  24. }
  25. .box3 {
  26. position: relative;
  27. width: 100px;
  28. height: 100px;
  29. background-color: greenyellow;
  30. top: -90px;
  31. left: -120px;
  32. }
  33. </style>
  34. </head>
  35. <body>
  36. <div class="box1">
  37. <div class="translate">
  38. <div class="box2"><div class="box3"></div></div>
  39. </div>
  40. </div>
  41. </body>
  42. </html>