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

前端 未结 8 1015
南方客
南方客 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:25

    Only thing I can think of is to add:

    html, body
    {
        width: 100%;
    }
    

    Just to make sure safari knows the parent container of field is also 100%;

    Another thing to try is to add:

    html { overflow-y: scroll; }
    

    That should force a side scrollbar, even if it's grayed out. I wonder if some webkit rendering temporarily flashes a scrollbar, but fails to give the space back. Any of that work?

提交回复
热议问题