html - I added a background image using css in the body. It displays normally on the computer but is blank on the mobile phone.
三叔
三叔 2017-06-22 11:53:28
0
6
951

body{

background:url(../img/bg.jpg)no-repeat fixed 0 0/100% 100%;

}

May I ask why this is?

三叔
三叔

reply all(6)
巴扎黑

Have you added a viewport to the mobile page?

淡淡烟草味

Why don’t you add the background image to a p, and then set the style of p: width: 100%; height: 100%? Isn’t it bad to put it directly on the body?

大家讲道理

I tried it and everything is normal

给我你的怀抱

Try to write the background attributes separately, such as background-image, background-position. . . Like this~

学习ing

no-repeat with a space in front

学习ing

I was so stupid. I have never noticed that I need to increase the width and height of html and body by 100%. Thanks to all the great people above.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template