- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
想要的结果是
第二个 div 内的 div 应该总是有 overflow-y 滚动
。
底部的按钮应该始终贴在窗口底部
这个结构应该是响应式的,即使在调整大小时也应该保持这样。
我愿意使用 bootstrap 或解决此问题的东西
.border {
border: 1px solid
}
<div class="border" style="height: 79px;">
</div>
<div class="border" style="height: 716px; overflow-y: scroll; margin-top: 20px">
<div class="border" style="height: 79px;">
</div>
<div class="border" style="height: 79px;">
</div>
<div class="border" style="height: 79px;">
</div>
<div class="border" style="height: 79px;">
</div>
<div class="border" style="height: 79px;">
</div>
<div class="border" style="height: 79px;">
</div>
<div class="border" style="height: 79px;">
</div>
<div class="border" style="height: 79px;">
</div>
<div class="border" style="height: 79px;">
</div>
<div class="border" style="height: 79px;">
</div>
<div class="border" style="height: 79px;">
</div>
<div class="border" style="height: 79px;">
</div>
<div class="border" style="height: 79px;">
</div>
<div class="border" style="height: 79px;">
</div>
<div class="border" style="height: 79px;">
</div>
<div class="border" style="height: 79px;">
</div>
</div>
<button style="width: 100%">This button should stick to bottom</button>
最佳答案
您可能需要使用额外的 div 获得窗口内的所有空间,因为容器广告将其粘贴到边缘(顶部/左侧/右侧/高度 = 0 像素)!
您甚至可能需要制作容器 overfolow:none
以供将来使用!
使用 CSS 函数“calc”计算的可滚动 div 的高度如下:
.container {
position: absolute;
left: 0px;
top: 0px;
bottom: 0px;
right: 0px;
margin: 10px;
}
.scrollable {
overflow-y: scroll;
margin-top: 20px;
height: calc(100% - 124px);
/*124px => 10px on container margin + 79px top div + 15px button + 20 px this top margin*/
}
.border {
border: 1px solid
}
<div class="container">
<div class="border" style="height: 79px;"></div>
<div class="border scrollable">
<div class="border" style="height: 79px;"></div>
<div class="border" style="height: 79px;"></div>
<div class="border" style="height: 79px;"></div>
<div class="border" style="height: 79px;"></div>
<div class="border" style="height: 79px;"></div>
<div class="border" style="height: 79px;"></div>
<div class="border" style="height: 79px;"></div>
<div class="border" style="height: 79px;"></div>
<div class="border" style="height: 79px;"></div>
<div class="border" style="height: 79px;"></div>
<div class="border" style="height: 79px;"></div>
<div class="border" style="height: 79px;"></div>
<div class="border" style="height: 79px;"></div>
<div class="border" style="height: 79px;"></div>
<div class="border" style="height: 79px;"></div>
<div class="border" style="height: 79px;"></div>
</div>
<button style="width: 100%;">This button should stick to bottom</button>
</div>
关于javascript - 如何使溢出 y 滚动响应的 div(高度明智)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57479830/
我有一个包含 1+N 个线程和 N 个 FIFO 队列的程序,例如:FIFO_queue_t* fifo_queque[N]。一个线程负责填充这 N 个 FIFO 队列。并且其他每个线程都与 1 个
我正在使用 Wise Installer Editor 编写 .msi,并且我想将所有文件复制到注册表项中指定的目录中。 我如何在 Wise 中指定这一点? 提前致谢, 埃内斯托 最佳答案 您可以尝试
我们有一个场景,其中我们尝试获取附加的磁盘虚拟机以及分配给这些磁盘的相应总空间。是否有任何命令或脚本可以获取详细信息? 我已使用命令 Get-AzureDisk 获取输出,但它没有显示列表中的所有虚拟
我有一个包含多个派生类的类,每个派生类都有自己的构造函数。 class A { public: static A *create_new_A(int child_ID);
我有一个小问题:) 我计划建立一个相当不寻常的 web 项目,大约有 1000 个页面,其中不会有经典的导航(仅适用于关于页面和联系人),并且所有页面都不会链接到一个又一个。 它的索引 > 打开随机页
我们的应用程序中有一些数据。有时它会被保存,所以我们为它做了一个实体和一个 NSManagedObject 子类。但是,通常情况下,对象将被实例化并且永远不会保存。我正在考虑使用另一个具有 NSInM
假设我有一个表如下: Class | Subject | Student | Marks ---------------------------------------- 1
刚刚在我正在编写的一些代码中偶然发现了这种情况,并且很好奇“正确”的方法是什么。举例来说,我有一大堆对象,我需要按某个属性对其进行分组,但组的顺序很重要。 例如。对象: var obj = {
如何在 Android 应用 Activity 中启用 Mutli 窗口选项? 我尝试在两个单独的 Activity 中使用 AndroidManifest Activity 属性 android:r
我发现 ear 插件覆盖了 war 插件并阻止调用 war 任务。我通过直接调用它来绕过它。 这是远程明智的还是我应该放弃并转向 eclipse 和 gradle 中的多项目设置? ear {
我们的安装程序是用 Inno Setup 编写的,我们实际上对它非常满意。然而,一些客户不断要求他们可以更轻松地通过 Active Directory 分发 MSI 安装程序。通过扩展 Inno Se
我正在尝试使用 Visual Studio 2017 (v15.4.5) 将现有的 WCF Web API(针对 .NET Framework 4.6.1)移植到 ASP.Net Core 2,但在找
我是一名优秀的程序员,十分优秀!