有没有办法只使用 CSS 设置 div 的高度,这样它就会填充页面高度的提示?
我对网页(客户的自定义框架)的控制非常有限,无法更改任何 html 或使用 javascript。 基本上我有一个文本框,我可以在其中编写 CSS,仅此而已。
此外,我不能进行根本性的更改(例如引入 flex 或类似的东西),因为它会破坏页面/站点。 该网站不使用任何媒体查询或定义视口(viewport)或类似的东西。他们基本上使用 HTML 3.2。它是一个 ASP.NET WebForms 站点,其核心部分构建于 2002 年至 2005 年左右。
...
<body>
...
<div id="rowContainer"> <!-- This is the div that needs to go all the way down to the very end
of the entire page.
(NOTE: NOT the end of the visible part of the page) -->
<!-- child elements consist of hierarchy of divs
(but are row based, the content of a "row" is undefined),
which use a mixture of relative, absolute and fixed positioning.
They are dynamically generated and they are "undefined",
so no assumptions can be made about the child nodes -->
<div css="row" > ... </div> <!-- These child divs might all be
absolutely positioned -->
<div css="row" > ... </div>
<div css="row" > <!-- row content is undefined and can change at any time --> </div>
<div css="row" > ... </div>
</div> <!-- There are no other visible elements after the "rowContainer" -->
</body>
最佳答案
使用
#rowContainer{
height:100vh;
}
关于css - 设置 div 的高度,使其延伸到页面的最后,仅使用 css?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56987614/