abs-pos-auto-margin-centered-ref.html 598 B

123456789101112131415161718192021222324252627282930313233
  1. <!DOCTYPE HTML>
  2. <title> absolutely positioned element should be vertically centered even if the height is bigger than that of the containing block (reference) - bug 812899</title>
  3. <style>
  4. body > div {
  5. font-size: 16px;
  6. position: relative;
  7. border: red solid;
  8. margin-top: 5em;
  9. width: 5em;
  10. height: 5em;
  11. }
  12. body > div > div {
  13. position: absolute;
  14. border: medium solid blue;
  15. margin: -23px auto;
  16. height: 150%;
  17. width: 150%;
  18. left: 0px;
  19. right: 0px;
  20. top: 0px;
  21. bottom: 0px;
  22. }
  23. </style>
  24. <body>
  25. <div>
  26. <div></div>
  27. </div>
  28. </body>
  29. </html>