HTML5 Canvas distorted?

前端 未结 3 942
抹茶落季
抹茶落季 2020-12-17 10:07

I thought for a bit of fun I would have a look at the canvas. It seemed fairly easy to draw a box so I pretty much copied an example from the mozilla developer site. You can

3条回答
  •  不知归路
    2020-12-17 10:27

    I had the same problem, but I was able to solve it, and include the height and width tags in my css, but I could not used the 'px' unit or '%' on the height or width.

    canvas#my-id{
        width:400;
        height:300;
    }
    

    Whether you use the html tag, css or set it with javascript/jquery etc shouldn't be matter.

提交回复
热议问题