Line break does not work in canvas

ctx.fillText('Ура вы победили!\nСписок результатов:' , 125, 40) ; /n, /r, /r/n, +<br>+,+<br/>+,+<br\/> (I tried not working)

2/2/2020 1:39:51 PM


5 Answers

New Answer




It should be backslash \ for escaping character Explicitly, line break is \n instead of /n.


I think Aymane's link best explains how to do "line break" in canvas fillText() with for loop.


Gordon I wrote it the first time, and then changed it for reinsurance


Thanks all