Nenhuma Descrição

offset-parent.html 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <!DOCTYPE html> <title>Basic Visual Test</title>
  2. <style>
  3. @import '/reset.css';
  4. html,
  5. body {
  6. height: 1500px;
  7. }
  8. #reference {
  9. position: relative;
  10. top: 150px;
  11. left: 150px;
  12. width: 200px;
  13. height: 200px;
  14. background-color: red;
  15. box-shadow: inset 0 0 0 1px black;
  16. }
  17. #popper {
  18. width: 100px;
  19. height: 100px;
  20. background-color: rebeccapurple;
  21. box-shadow: inset 0 0 0 1px black;
  22. }
  23. </style>
  24. <div style="position: relative;">
  25. <table>
  26. <tr>
  27. <td>
  28. cell
  29. </td>
  30. <td>
  31. cell
  32. </td>
  33. <td>
  34. <div style="position: relative">
  35. <div id="reference">Reference Box</div>
  36. </div>
  37. </td>
  38. </tr>
  39. </table>
  40. </div>
  41. <div id="popper">Popper Box</div>
  42. <script type="module">
  43. import { createPopper } from '../dist/popper.js';
  44. const reference = document.querySelector('#reference');
  45. const popper = document.querySelector('#popper');
  46. window.instance = createPopper(reference, popper, {
  47. placement: 'right',
  48. });
  49. </script>