简体   繁体   中英

How to add background image to HTML5 canvas sketchpad?

I use the Responsive Sketchpad - demo and Github . What is the proper way to set the background image (instead of white background) which will fully responsive with that HTML5 canvas sketchpad?

.canvas{
    background-color: transparent;
    background-size: cover;
    background-image: url(https://s.ill.in.ua/i/news/630x373/397/397742.jpg);
}

worked fine for me 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM