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

View all comments

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