user2587454 user2587454 - 1 year ago 81
CSS Question

how to draw a shape by using canvas or css?

i'm looking for a way to create this shape with html(css) or canvas.


enter image description here

Answer Source

Try this:

  var canvas = document.getElementById('myCanvas'),
      context = canvas.getContext('2d'),
      startAngle = 1.2 * Math.PI,
      endAngle = 0.8 * Math.PI;

  context.moveTo(50, 70);
  context.lineTo(250, 70);
  context.arc(300, 100, 50, startAngle, endAngle, false);
  context.lineTo(50, 130);
  context.lineWidth = 5;
  context.strokeStyle = 'blue';

For detailed information have a look here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download