Skip to content

Change the CSS attributes of outer div > canvas #1222

Answered by drcmda
mohito12 asked this question in Q&A
Discussion options

You must be logged in to vote

you are not supposed to change size, although you can of course give it styles and classes <Canvas style={{ ... }} class="..." /> but better size the div that wraps it. canvas will automatically take up the space of its relative/absolute parent with a resize observer.

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@shahnihal01
Comment options

@shahnihal01
Comment options

@xr-dev-saurabh
Comment options

@drcmda
Comment options

@xr-dev-saurabh
Comment options

Answer selected by mohito12
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants