100% width divs not spanning entire width of the browser in webkit

前端 未结 8 1018
南方客
南方客 2021-01-08 01:10

I\'m having a hard time with what I thought would be a dead simple issue.

I\'m trying to create a div that spans 100% of the width of a browser window. The div is f

相关标签:
8条回答
  • 2021-01-08 01:36

    From my experience on a similar issue. When your code will not stretch the entire way on the mobile device (but will on the desktop), fixing it is a matter of finding some element that is pushing the boundary invisibly. There should be some item that is breaking out of its boundary - for me it was a logo image that was sticking about 20px outside the header div. You can find this by giving everything a border or by eliminating one thing at a time. Once you have found it, you can move it or remove it in order to allow things to stretch the full way again.

    0 讨论(0)
  • 2021-01-08 01:39

    Noticed this wasn't answered. I was having the same issue. I added the following lines to my CSS class:

    margin-right:-10px;
    margin-left:-10px;
    
    0 讨论(0)
提交回复
热议问题