android autofit mode causing issues with css width in web page

前端 未结 13 1555
挽巷
挽巷 2020-12-13 10:49

I am having problems with the auto resize feature of the android browser. The widths on my site are going a bit haywire when the device is in portrait mode.

What I w

13条回答
  •  不知归路
    2020-12-13 11:23

    I just wanted to confirm that Delbert's solution was the only thing that worked for me. It's not completely apparent as to why this works, but it works. I've done some fairly exhaustive searching on the issue, and the links from Tom's original post seems to include about all there is out there.

    For what it's worth, I tried some fairly aggressive attempts at correcting the width of some

    tags nested deeply within a chain of

    tags using some of the proposed solutions here:

    * { background-color: transparent; } did not work for me. However, * { background-image: url("/image/pixel.png"); DID work for me (where pixel.png is a 1x1 transparent PNG). I eventually relaxed this to apply only to my nested

    tags, and found that my paragraphs were finally spanning the intended, correct width.

    I also confirmed that the behavior is a result of the "Auto-fit web pages" setting. I do not own an Android, but experienced these issues using the emulator.

    Thanks again to Delbert for the tip.

提交回复
热议问题