block-percent-1-dyn.html 582 B

123456789101112131415161718192021222324252627282930313233
  1. <!DOCTYPE html>
  2. <html class="reftest-wait">
  3. <head>
  4. <style type="text/css">
  5. #parent {
  6. width: 200px;
  7. }
  8. #block1 {
  9. height: 40px;
  10. margin-bottom: 10%;
  11. background-color: green;
  12. }
  13. #block2 {
  14. height: 40px;
  15. background-color: green;
  16. }
  17. </style>
  18. <script type="text/javascript">
  19. function test() {
  20. document.getElementById('block2').style.marginTop = '25%';
  21. document.documentElement.removeAttribute('class');
  22. }
  23. document.addEventListener('MozReftestInvalidate', test, false);
  24. </script>
  25. </head>
  26. <body>
  27. <div id="parent">
  28. <div id="block1"></div>
  29. <div id="block2"></div>
  30. </div>
  31. </body>
  32. </html>