简体   繁体   English

将模态放置在所有分辨率的底部

[英]Placing the modal at the bottom for all resolutions

I'm using react-bootstrap modal in my project.我在我的项目中使用 react-bootstrap 模式。 I need to place the modal at bottom of all the resolutions.我需要将模态放在所有分辨率的底部。 For example, I can place the modal at bottom by changing css bottom property to -74% in 1080x1920 resolutions.例如,我可以通过在 1080x1920 分辨率下将 css 底部属性更改为 -74% 来将模态放置在底部。 But for other devices it is not the same.但对于其他设备,情况就不一样了。

<div role="dialog" aria-modal="true" class="fade modal show" tabindex="-1" style="display: block; padding-left: 0px;">
   <div role="document" class="modal-dialog sc-modal">
      <div class="modal-content">...
      </div>
   </div>
</div>



.sc-modal{
    width:100% !important; 
    top: unset;
    bottom:0%;
    max-width: 1080px;
    left: 50%;
    transform: translate(-50%, 0) !important;
}

How to place the modal at the bottom for all device resolutions ?如何将模式放在所有设备分辨率的底部?

position should help you fix the modal at the bottom of the window. position应该可以帮助您修复窗口底部的模态。

.modal.in .modal-dialog {
   position: fixed;       
   bottom: 0;
   left: 50%;
   transform: translate(-50%);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM