css-transform-box.html 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <!doctype html>
  2. <link rel="match" href="reference/css-transform-box-ref.html" />
  3. <style>
  4. svg {
  5. width: 400px;
  6. height: 400px;
  7. border: 1px solid #d9d9d9;
  8. }
  9. .box {
  10. stroke-width: 4;
  11. transform-origin: 20% 20%;
  12. transform: scale(1.5);
  13. }
  14. div.box {
  15. width: 40px;
  16. height: 40px;
  17. border: solid black;
  18. border-width: 10px 20px 30px 40px;
  19. margin: 80px;
  20. }
  21. </style>
  22. <div class="box" style="transform-box: content-box">Hi</div>
  23. <div class="box" style="transform-box: border-box">Hi</div>
  24. <svg id="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
  25. <!-- NOTE: We don't currently calculate the fill or stroke boxes for SVG elements, so the test will need to be
  26. rebaselined once we do! -->
  27. <rect class="box" style="transform-box: fill-box" x="10" y="10" width="10" height="10" stroke="black" fill="yellow" />
  28. <circle fill="red" r="1" cx="15" cy="15" />
  29. <rect class="box" style="transform-box: stroke-box" x="10" y="40" width="10" height="10" stroke="black" fill="cyan" />
  30. <circle fill="red" r="1" cx="15" cy="45" />
  31. <rect class="box" style="transform-box: view-box" x="10" y="70" width="10" height="10" stroke="black" fill="green" />
  32. <circle fill="red" r="1" cx="15" cy="75" />
  33. </svg>