android autofit mode causing issues with css width in web page

前端 未结 13 1568
挽巷
挽巷 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:27

    I have been experiencing this problem and found a solution that works for me.

    I have one main

    with some nested
    elements inside. The HTML is very basic. I found that one
    within my main
    would wrap its text as if I had double-tapped the text to zoom in on it. This
    only contained text. This behavior occurred only in portrait orientation, and it corrected after double-tapping or switching orientation.

    Since this problem is an Android bug, no CSS or HTML can really fix it. However, the following CSS resolved the problem satisfactorily for me; and I didn't have to turn off "Auto-fit pages":

    I added a CSS background-image to the

    . I just used a transparent, one-pixel PNG as the background.

    div { background-image: url(../img/blank.png); }

提交回复
热议问题