为什么会多出3px?
Because canvas is an inline replacement element by default, and the 3px is the distance between its baseline and the bottom of the line. Set his display to block to solve this problem.
canvas
display
block
Because
canvas
is an inline replacement element by default, and the 3px is the distance between its baseline and the bottom of the line.Set his
display
toblock
to solve this problem.