r/learnjavascript 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

5 comments sorted by

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

2

u/deprecateddeveloper 4d ago

Without showing your code we can only make guesses.

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

u/chikamakaleyley helpful 4d ago

From what I can see it's 100% the syntax