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
angryTomOriginal
2020-03-24 11:42:223547browse

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;}

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;}

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!

Statement:
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