html - 调整大小时如何在不删除水平滚动条的情况下删除空白?

标签 html css

如果我添加以下css

html,body{
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow-x: hidden;
}

这将解决空白问题,但它会删除水平滚动条,并且无论窗口大小如何,它都会应用 100% 宽度,但我的网站包含固定宽度。我可以在这里做什么?

最佳答案

使用 min-width 来实现您想要的。

例如,

html,body{
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow-x: hidden;
min-width:xxpx; /* enter a pixel value more than 1px that distorts the layout on resize */
}

PS:xxpx是一个代表值。使用最适合解决问题的值。

关于html - 调整大小时如何在不删除水平滚动条的情况下删除空白?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20470381/

相关文章:

css - 为什么我的 JsFiddle 中的 CSS 在我的服务器中的工作方式不同?

css - 使缓存无效或添加http请求

php - 使用 ajax 更改 index.php 中的 php 变量值且无需重新加载页面

jquery - 将 HTMl5 应用程序移动到 ipad 时要注意什么?

html - 固定页脚在页面底部

css - 无法覆盖 Doxygen 中的搜索框 css 规则

html - 我怎样才能在div之间画一条垂直线?

html - 输入事件状态下标签转换的意外行为

html - 我怎样才能有响应线 '-----' ?

html - CSS 图像边距底部