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
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.