我想将模式类设置为高度750px,即使屏幕缩小也是如此。我能够将content1设置为在模式中溢出,但.modal
会占用整个屏幕。
https://stackoverflow.com/posts/65815926/edit#
.content1 {
overflow-y:auto;
}
<div class="modal">
<div>
<div>
<div class="content1">
</div>
<div class="content2">
</div>
</div>
</div>
</div>
我有一个模态,我想在此模态中设置高度750px,但是当我打开chrome dev工具时,它将在右侧创建一个滚动条。我尝试过,overflow: hidden
但这不会让我滚动弹出窗口。谢谢
假设您使用的是Bootstrap,则可以随时尝试:
.modal-open .modal {
margin-right: -10px;
margin-left: -10px;
}
有点黑,但它会在视觉上隐藏滚动条,仍然可以滚动。
更新的答案:
您可以尝试使用CSS隐藏滚动条:
.modal-open .modal::-webkit-scrollbar {
display: none;
}
.modal-open .modal {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句