Home > Article > WeChat Applet > 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.
(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.
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!