如何获得具有可垂直滚动的卡片文本部分的固定高度bootstrap 4卡?
<div class="card" style="height:300px"> <-- non scrollable
<div class="card-body"> <-- non scrollable
<h5 class="card-title">Card title</h5> <-- non scrollable
<p class="card-text">This portion and only this portion will have a very long text so much so that the vertical scroll bar may appear when required.</p>
</div>
</div>
您必须.card-text
使用可滚动容器包装。然后设置可滚动容器overflow-y: auto;
。
不要忘记也height
为可滚动容器设置了。如果height
默认为自动,则滚动条将不会出现。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句