A way to correct background scaling in iPad's Safari?

前端 未结 6 1847
醉酒成梦
醉酒成梦 2021-01-31 09:45

I have a website using a huge background image (2000x1500) in a div container (100% x 100%).

When I open that site on Safari on an iPad it gets scaled down (~40%) in a d

6条回答
  •  自闭症患者
    2021-01-31 10:17

    It seems that this issue only occurs on the iPad when you have a background image that is attached the the tag. If you place the background image into a containing div, the issue can be resolved -- this is a great work-around if you don't need to have your background image "fixed", as the techniques to make background fixed work in IE mandate that you use the tag for images.

    You can see the difference in these two sites, the first uses the tag for positioning (due to the fixed positioning on the background image) and the second uses a containing div:

    http://www.mricsi.com http://www.collinshirsch.com

    Hope that helps!

    edit -- this is not entirely accurate -- it seems like this is the case only some of the time, and the reason behind why is unclear.

提交回复
热议问题