100%宽度分割截止
我的 HTML 页面中有许多 width: 100%;
分区,但是当我放大页面或以低分辨率查看时,某些内容会超出水平限制屏幕的宽度(因此会出现水平滚动条),我发现向右滚动会导致 100% 宽度划分被切断。
这种效果演示如下:
I have a number of width: 100%;
divisions as part of my HTML page, however when I zoom in on the page or view on a low resolutions such that some of the content goes past the horizontal limit of the screen (and hence a horizontal scrollbar appears), I find that scrolling to the right results in my 100% width division cutting off.
This effect is demonstrated below:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Stack Overflow 上的这个网页也发生了同样的情况。如果您使用 FF5.0 进行放大,则当您向右滚动时,页脚和页眉会被“剪切”。这是因为内容 div 必须在右侧溢出。
我认为你想避免侧面溢出(这不美观,而且更难浏览页面)。
解决方案可能是不使用具有最小宽度的 div(例如,此网页的 div#content 为 960px),而是使用可变宽度 (50%)。如果放大,width=50%将保持50%,不会溢出。
PS:但最好使用一些 JavaScript 代码来为您进行缩放,这样您就可以或多或少地控制最终用户在单击您在页面上提供的缩放按钮时看到的内容。
The same happens with this web page, here on Stack Overflow. If you zoom in using FF5.0, the footer and headers are "cut" when you scroll right. This is because the content div has to overflow on the right.
I think you want to avoid having overflows on the side (it's not aesthetically pleasing, and it's harder to navigate through the page).
A solution could be to not have divs that have a minimal width (eg 960px for the div#content of this web page), but rather are variable (50%). If you zoom in, width=50% will stay 50%, it will not overflow.
PS: but it might be better to have some JavaScript code to do the zoom for you, so that you can more or less control what the end-user sees when they click on the zoom button that you'd provide, on the page.