html - 如何给一个div无限宽度?

标签 html css width

假设有两个 div,A 和 B。

Div B 的宽度为 900px;

屏幕分辨率为500px;

这会导致水平滚动。

问题是当我向右滚动时,我看到 DivA 并不是真正的 100%。

有什么方法可以让 DivA 始终填满剩余空间?

看图

enter image description here

添加下图以解释问题:

enter image description here

最佳答案

你好,现在给你的 body min-width:900px;

像这样

body{
min-width:900px;  // total width of your wraper as like wraper width 
}

关于html - 如何给一个div无限宽度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12581588/

相关文章:

html - CSS first-child 和 nth-child 无法正常工作

html - CSS Float 行为(即使在检查 W3C 之后)

css - 在 Bootstrap 中创建响应式卡片组

html - Unslider 样式问题点

jquery - 是否可以根据开发人员使用 CSS 指定的内容,使用 jQuery 获取元素的宽度(以百分比或像素为单位)?

html - 使用翻译百分比垂直居中元素

javascript - 我可以在 iframe 中显示网站图标吗?

css - 如何在有 Angular Material 中水平对齐单选按钮?

WPF DataGrid 同步列宽

javascript - 如何在 jQuery 中获取溢出元素的可见高度