Home >WeChat Applet >Mini Program Development >Modify the background color of a single page of the mini program

Modify the background color of a single page of the mini program

王林
王林forward
2021-02-08 10:22:413291browse

Modify the background color of a single page of the mini program

First of all, I planned to set a global background color, so I set the windows object in app.json as follows:

  "window": {
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "#fff",
    "backgroundColor": "#f6f6f8",
    "navigationBarTextStyle": "black"
  },

The first reaction on the page was the same. Using a separate json file to set

{
      "backgroundColor": "#fff",
      "navigationBarTitleText": "添加评价"
}

I found out decisively that it was useless and the page background was still gray.

Modify the background color of a single page of the mini program

(Learning video sharing: Introduction to Programming)

Solution, set a page class in the corresponding wxss file:

 page {
  background-color: #fff;
}

In this way, the background color of the entire page is set to all white, and it does not affect other pages. Other pages have special requirements and can be modified in the same way.

Modify the background color of a single page of the mini program

Related recommendations: 小program development tutorial

The above is the detailed content of Modify the background color of a single page of the mini program. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete