When I say incorrect, obviously the thing will work – but is there anything illegal, wrong or invalid about using it in that way?
Say just for a (x) button to close a window? (Obviously with the image stated in the CSS and no content in the element).
I know there are a wide choice of elements that could be used, <button>, <div>, <span> etc.. but is this completely wrong or is it fine?
The
canvaselement is not supported by IE8 and lower, so you cannot rely on acanvasif you are going to support IE8.Also, my guess is that the canvas solution might be less performant than a simple image.