Haw can I draw a line at 45° angle using <path> tag. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 10

Haw can I draw a line at 45° angle using <path> tag.

8th Nov 2019, 6:32 PM
Shreyansh
Shreyansh - avatar
3 Answers
+ 2
A very quick example with a line facing 45deg down: <svg> <path d="M 0 0 L 100 100" stroke="red" stroke-width="3" fill="none" /> </svg>
8th Nov 2019, 7:21 PM
Veliside
Veliside - avatar
+ 4
Veliside could you explain
8th Nov 2019, 7:54 PM
Shreyansh
Shreyansh - avatar
+ 3
M 0 0 is the starting point, at 0,0 pixels of the screen L 100 100 is a line that ends at 100,100 pixels away from the starting point So we have a diagonal line of a square, which has an angle of 45deg.
8th Nov 2019, 9:19 PM
Veliside
Veliside - avatar