Centering a canvas

后端 未结 11 1439
野的像风
野的像风 2021-01-30 10:00

How do I markup a page with an HTML5 canvas such that the canvas

  1. Takes up 80% of the width

  2. Has a corresponding pixel h

11条回答
  •  被撕碎了的回忆
    2021-01-30 10:58

    Given that canvas is nothing without JavaScript, use JavaScript too for sizing and positionning (you know: onresize, position:absolute, etc.)

提交回复
热议问题