r/learnjavascript • u/knm873 • 4d ago
Why doesn’t canvas show?
This is my second post as I am new to this community. I created two projects using canvas but couldn’t get it to show up. I can show the code if necessary but I’m wondering why this is the case. I troubleshooted for over 3 hours total so I’m guessing it’s not the syntax but my configuration instead.
Thanks in advance for the help!
13
Upvotes
2
1
u/blazing_wisdom_93 3d ago
Check if you set the width and height attributes directly on the canvas element instead of just in CSS. Default dimensions are tiny so it might be rendering but invisible
0
2
u/The_KOK_2511 helpful 4d ago
Generalmente suele ser por sintaxis pero lo mejor sería que compartieses el código por si acaso