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

王林
Release: 2021-02-09 14:40:26
forward
3295 people have browsed it

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"
  },
Copy after login

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

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

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;
}
Copy after login

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!

Related labels:
source:csdn.net
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