Home  >  Article  >  Web Front-end  >  How to set page background color in uniapp

How to set page background color in uniapp

coldplay.xixi
coldplay.xixiOriginal
2020-12-08 11:19:0838686browse

Uniapp method to set the background color of the page: 1. Use the relevant code to set [page{background-color:#ddd;}]; 2. If you want to set the background of the window, you can set it in [pages.json] Set in, the code is [backgroundColor": "#ddd].

How to set page background color in uniapp

The operating environment of this tutorial: windows7 system, uni-app2.5.1 version, Dell G3 computer.

Recommended (free): uni-app development tutorial

uniapp How to set the background color of the page:

If you want to set the background color for the page, you should set it as follows

page{
background-color:#ddd;
}

If you want to set the background of the window, you can set it in pages.json , as follows

{
    "pages": [
        {
            "path": "pages/index/index", 
            "style": { 
            “backgroundColor”:“#ddd”
             }
        }
    ]
}

Related free learning recommendations:Programming Video

The above is the detailed content of How to set page background color in uniapp. 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