gpt4 book ai didi

css - 相对于模态底部定位 Bootstrap 模态

转载 作者:太空宇宙 更新时间:2023-11-04 11:57:27 24 4
gpt4 key购买 nike

我对 CSS 定位比较陌生,我搞不懂这个:

我想从页面底部定位模态 10vh 的底部。换句话说,模态的底部应该距离页面底部 10vh。我尝试过使用不同的“顶部”、“底部”等值以及使用 jQuery 以编程方式执行此操作,但我开始迷路并意识到使用 CSS 可能有更简单的方法。这是我正在使用的 [Bootstrap] 模式的代码:

<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog"   aria-labelledby="mySmallModalLabel" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
Testing 1-2-3.
</div>
</div>
</div>

最佳答案

使用position: absolutebottom: 10vh

.modal { 
position: absolute;
bottom: 10vh
}

关于css - 相对于模态底部定位 Bootstrap 模态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30089558/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com