How do you autofocus a canvas? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do you autofocus a canvas?

I need to autofocus a canvas on my snake game. Check it out on my profile. I need to be able to make the user focus on the game before it starts. any ideas? Please look through my code, because I used the power of google, and to my dismay, it failed.

19th Mar 2019, 5:50 AM
Johan Novak
Johan Novak - avatar
1 Answer
+ 1
//Canvas can't be auto focused but you can give canvas border a attractive color //css canvas{ border:2px solid red; box-shadow:0 4px 8px red; }
20th Mar 2019, 8:44 PM
Sudarshan Rai
Sudarshan Rai - avatar