intersecting-clipping-1-canvas.html 432 B

123456789101112131415161718192021
  1. <!DOCTYPE HTML>
  2. <title>Test for clipping of border-radius</title>
  3. <style>
  4. div {
  5. overflow: hidden;
  6. width: 200px;
  7. height: 100px;
  8. border-radius: 50px / 20px;
  9. }
  10. canvas {
  11. border-radius: 20px / 40px;
  12. }
  13. </style>
  14. <div><canvas id="canvas" height="100" width="200"></canvas></div>
  15. <script>
  16. var canvas = document.getElementById("canvas");
  17. var cx = canvas.getContext("2d");
  18. cx.fillStyle="lime";
  19. cx.fillRect(0, 0, 200, 100);
  20. </script>