简体   繁体   中英

background: linear-gradient() not working on mobile

I made a simple page on codepen but background: linear-gradient is not working on mobile. It is showing color on the computer but not in mobile.

Here is my code link: https://codepen.io/jjarus/pen/OGwJqv

And my CSS:

body {
    margin: 0;
    padding: 0;
    font-size: 1.2em;
    background: -webkit-linear-gradient(orange, white, green);
}

put this also in your css

background: linear-gradient(orange,white,green);

your css is specific for chrome browser as you mentioned webkit.

In your css, you just set gradient background only for webkit browsers:

background: -webkit-linear-gradient(orange,white,green);

Simply, add the following code to your css:

background: linear-gradient(orange,white,green);

I suggest you use cssgradient.io for creating css gradient background easily with the highest compatibility with any browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM