Kevin Powell - CommunityKP-C
Kevin Powell - Community3y ago
37 replies
ccabd

Canvas in flexbox not resizing properly

Any idea why the canvas in this example code takes the full width of the viewport?

https://codepen.io/codecab/pen/abXaKJr?editors=1100

When I replace the canvas with a div it works as expected. I put the canvas in a wrapper element for now, which works, but I'd like to understand why its behaving as it does. Am I missing something?
Was this page helpful?