How to prevent div from getting cut of when resizing window?

对着背影说爱祢 提交于 2020-01-16 19:15:52

问题


I have a div on the left side of the browser that shows fine, but once I resize the window's width, it gets cut off on the left side. This is fine, but the browser doesn't provide an option to scroll left to see the rest of the div.

As opposed to a div I have on the right side of the page, where if I shorten the width of the window and that right div gets cut off on the right side, the browser always at least lets me scroll right to see the rest of the div.

How i can make it so on the left side as well? I tried adding a left margin but that didn't work.


回答1:


You should try adding

body{
    overflow: auto;
}

This should automatically add scrollbars when something goes out of view.




回答2:


Body margin might be set to something like

margin-left: -10px

Or something like that. If you have been working with responsive CSS. You might have a setting with the div being positioned left so many px/%



来源:https://stackoverflow.com/questions/22740166/how-to-prevent-div-from-getting-cut-of-when-resizing-window

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!