Responsive website on iPhone - unwanted white space on rotate from landscape to portrait

前端 未结 12 1573
挽巷
挽巷 2020-11-29 22:21

I am creating a responsive website, and have just noticed a strange behaviour in my content pages when viewed on the iPhone. It scales correctly when loaded in portrait mode

12条回答
  •  野性不改
    2020-11-29 23:01

    Using "overflow-x: hidden" solves part of the problem, but screws the scroll, acting with strange behaviors (as Jason said).

    Sometimes, the hardest part is to discover what is causing the problem. In my case, after a few hours, if found that the problem was in Twitter's Bootstrap:

    If you're using Twitter's Bootstrap with "control-group" zones for your forms, the problem could be there. In my case i solved the problem with:

    .control-group .controls {
         overflow-x: hidden
     }
    

    Now the white space on the right was gone :)

提交回复
热议问题