Home › Forums › CSS › canvas width in % not works get converted to px › Reply To: canvas width in % not works get converted to px
November 28, 2014 at 7:27 am
#189414
Senff
Participant
Maybe you misunderstood.
In the HTML/DOM, the canvas dimensions have to be defined in pixels. This sounds like it’s static, and technically it is, but you can resize and make it dynamic with CSS, and use percentages.
You can NOT use percentages in the HTML part.
See this pen for an example, where the canvas is 100% of the (outlined) container: