Answers for "draw traingle in html"

CSS
1

how to draw a triangle using javascript

<!doctype html>
<html>
<head>
<body>
<canvas></canvas>
<script>
var canvas=document.querySelector('canvas');
var context=canvas.getContext(2d);
context.beginPath();
    context.moveTo(75,75);
    context.lineTo(10,75);
    context.lineTo(10,25);
    context.fill();
    </script>
    </body>
    </head>
    </html>
Posted by: Guest on May-26-2020
5

how to create a shape in css

div {
	clip-path: polygon(100% 100%, 100% 100%, 100% 100%)
}
Posted by: Guest on June-27-2020

Browse Popular Code Answers by Language