I have a canvas thas is created dynamically, so width and height are always differents.
I have a background image i want to put on this canvas, so i just add in CSS :
canvas { background:url(/URL/background-canvas.jpg) }
But, how can i auto resize the image to the size of my canvas ? Thanks !
I believe you can do something like this:
canvas {
background: url('/URL/background-canvas.jpg');
background-size: 100% 100%;
}
See this for more info on it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With