Twitter bootstrap 引导4中的多模态位置

Twitter bootstrap 引导4中的多模态位置,twitter-bootstrap,bootstrap-4,Twitter Bootstrap,Bootstrap 4,在一个例子中,我被帮助使情态动词左右对齐,这很好。 现在,我想在中间添加“标准”模态,然而,模态左右对齐的解决方案似乎已经消除了任何标准模态。 我怎样才能使标准模态工作,以及左对齐和右对齐 由于某些原因,到js fiddle的链接是不够的,需要代码 <div class="container"> <div class="row"> <div class="col">

在一个例子中,我被帮助使情态动词左右对齐,这很好。 现在,我想在中间添加“标准”模态,然而,模态左右对齐的解决方案似乎已经消除了任何标准模态。 我怎样才能使标准模态工作,以及左对齐和右对齐

由于某些原因,到js fiddle的链接是不够的,需要代码

<div class="container">
    <div class="row">
        <div class="col">
            <h1>Some heading</h1>
            <p>This is not a love song</p>
            <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#leftModal">Left</button>
            <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#rightModal">Right</button>
            <button type="button" class="btn btn-primary" data-toggle="modal" data-target="middleModal">Middle</button>
        </div>
    </div>
</div>

<!-- Modal -->
<div class="modal fade" id="rightModal" tabindex="-1" role="dialog" aria-labelledby="rightModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-dialog-slideout" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="rightModalLabel">Right On</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
      </div>
      <div class="modal-body">
        Right Modal
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>

<!-- Left modal -->
<div class="modal fade" id="leftModal" tabindex="-1" role="dialog" aria-labelledby="leftModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-dialog-slideout" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="leftModalLabel">Left On</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
      </div>
      <div class="modal-body">
        Left Modal
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>

<!-- Button trigger modal -->


<!-- Middle Modal -->
<div class="modal fade" id="middleModal" tabindex="-1" role="dialog" aria-labelledby="middleModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="middleModalLabel">Middle Modal</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>

#rightModal .modal-dialog-slideout {min-height: 100%; margin: 0 0 0 auto;background: #fff;}
.modal.fade .modal-dialog.modal-dialog-slideout {-webkit-transform: translate(100%,0)scale(1);transform: translate(100%,0)scale(1);}
.modal.fade.show .modal-dialog.modal-dialog-slideout {-webkit-transform: translate(0,0);transform: translate(0,0);display: flex;align-items: stretch;-webkit-box-align: stretch;height: 100%;}
.modal.fade.show .modal-dialog.modal-dialog-slideout .modal-body{overflow-y: auto;overflow-x: hidden;}
.modal-dialog-slideout .modal-content{border: 0;}
.modal-dialog-slideout .modal-header, .modal-dialog-slideout .modal-footer {height: 69px; display: block;}
#rightModal .modal-dialog-slideout .modal-header h5 {float:left;color:blue;}

#leftModal .modal-dialog-slideout {min-height: 100%; margin: 0 auto 0 0;background: #fff;}
#leftModal .modal-dialog-slideout .modal-header h5 {float:left;color:red;}

#leftModal.modal.fade:not(.show) .modal-dialog.modal-dialog-slideout {
    -webkit-transform: translate(100%,0)scale(1);
    transform: translate(-100%,0)scale(1);
}

一些标题
这不是一首情歌

左边 赖特 中间的 马上 × 右模态 接近 保存更改 继续 × 左模态 接近 保存更改 中间模态 &时代; ... 接近 #模态对话框滑出{最小高度:100%;边距:0自动;背景:#fff;} .modal.fade.modal-dialog.modal-dialog-slideout{-webkit变换:平移(100%,0)比例(1);变换:平移(100%,0)比例(1);} .modal.fade.show.modal-dialog.modal-dialog-slideout{-webkit变换:平移(0,0);变换:平移(0,0);显示:柔性;对齐项:拉伸;-webkit框对齐:拉伸;高度:100%;} .modal.fade.show.modal-dialog.modal-dialog-slideout.modal正文{overflow-y:auto;overflow-x:hidden;} .modal对话框滑出.modal内容{边框:0;} .modal对话框滑出.modal页眉.modal对话框滑出.modal页脚{高度:69px;显示:block;} #模态对话框滑出。模态标题h5{float:left;color:blue;} #模态对话框滑出{最小高度:100%;边距:0自动0;背景:#fff;} #leftModal.modal对话框滑出。模式标题h5{float:left;color:red;} #leftModal.modal.fade:不(.show).modal-dialog.modal-dialog-slideout{ -webkit转换:转换(100%,0)比例(1); 变换:平移(-100%,0)比例(1); }
所有的模态现在都在工作。您的
数据目标
对于您的
中间
模式不正确。我也安装了一些CSS

现场演示:

#rightModal.modal对话框滑出{
最小高度:100%;
保证金:0自动;
背景:#fff;
}
.modal.fade.modal-dialog.modal-dialog-slideout{
-webkit转换:转换(100%,0)比例(1);
变换:变换(100%,0)比例(1);
}
.modal.fade.show.modal-dialog.modal-dialog-slideout{
-webkit转换:转换(0,0);
变换:平移(0,0);
显示器:flex;
对齐项目:拉伸;
身高:100%;
}
.modal.fade.show.modal-dialog.modal-dialog-slideout.modal主体{
溢出y:自动;
溢出x:隐藏;
}
.模态对话框滑出.模态内容{
边界:0;
}
.modal对话框滑出.modal标题,
.modal对话框滑出.modal页脚{
高度:69px;
显示:块;
}
#rightModal.modal对话框滑出.modal标题h5{
浮动:左;
颜色:蓝色;
}
#leftModal.modal对话框滑出{
最小高度:100%;
边距:0自动0;
背景:#fff;
}
#leftModal.modal对话框滑出.modal标题h5{
浮动:左;
颜色:红色;
}
#leftModal.modal.fade:不(.show).modal-dialog.modal-dialog-slideout{
-webkit转换:转换(100%,0)比例(1);
变换:平移(-100%,0)比例(1);
}

一些标题
这不是一首情歌

左边 赖特 中间的 马上 × 右模态 接近 保存更改 继续 × 左模态 接近 保存更改 中间模态 &时代; ... 接近