Home > WeChat Applet > Mini Program Development > What to do if the WeChat applet cannot set the background image

What to do if the WeChat applet cannot set the background image

angryTom
Release: 2020-03-24 11:42:22
Original
3549 people have browsed it

What to do if the WeChat applet cannot set the background image

What should I do if the WeChat applet cannot set the background image?

There are two solutions:

1. Directly use the image Quoting online images

.img-background {
  background: url('http://xx/xx/beauty.png');
  width: 200rpx;
  height: 160rpx;}
Copy after login

2. Base64 encode the local image and directly quote the base64 string

.img-background {
  url(data:image/png;base64,VCdweSsd98iVBORw0KGgoAAAANSUhEUgAAACgAAAAgCAYAAABgrToAAAAAAXNSR0IArs4c6QAAAHlJREFUWAnt2LEJwDAMRFE5c2ShLOKhsp69h3ISeAI1CnyBiJvA8dwcHu7+mNmrvbWdZivMHAq4dOgW7kDt65y6fiPg1AZnt8kr7haKPAgggAACfxOIskCbKdwabaaAlw0rmhaDAAIIIIBAQYA2U8CLX2kzFcB8m) no-repeat;
  width: 200rpx;
  height: 160rpx;}
Copy after login

Recommended learning: Small program development

The above is the detailed content of What to do if the WeChat applet cannot set the background image. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template