我坚持了一段时间。我在模态窗口中有很多输入来创建季节。但是它仍然没有响应(在较小的屏幕上看起来非常糟糕)。

另外,这两个按钮也应位于孔的右侧。我尝试了“向右拉”类或“向左浮动”和绝对位置之类的东西,但是它们总是越过灰色背景。我该如何解决?

<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
         <h3 class="pull-left">Seasons</h3>
    </div>

  <div class="modal-body" style="position: relative;">

    <div class="well">
        <div class="row" style="width: 80%; margin: 0;">
            <div class="col-sm-6">
                <span class="bold">Season name</span>
                <input type="text" placeholder="e.g. High season">
            </div>
            <div class="col-sm-3">
                <span class="bold">From</span>
                <input type="date" style="font-size: 1.23rem;  display: inline-block;">
            </div>
            <div class="col-sm-3">
                <div style="margin-left: 40px;">
                <span class="bold">To</span>
                <input type="date" style="font-size: 1.23rem;display: inline-block;">
                </div>
            </div>
        </div>
            <br>
            <button type="button" class="btn btn-default" data-dismiss="modal" style="position: absolute; right: 50px;">Close</button>
            <button type="button" class="btn btn-primary" style="position: absolute; right: 20px;">Save</button>
    </div>
  </div>
</div>





在线代码在这里:http://www.bootply.com/ojhdwC4y4x#

最佳答案

 <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
  Launch demo modal
</button>

<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">×</button>
             <h3 class="pull-left">Seasons</h3>
        </div>

      <div class="modal-body">

        <div class="well">
          <div class="input-group">
            <input type="text" class="form-control" placeholder="Season name" aria-describedby="basic-addon1">
          </div>
          <div class="input-group">
            <input type="text" class="form-control" placeholder="From" aria-describedby="basic-addon1">
          </div>
          <div class="input-group">
            <input type="text" class="form-control" placeholder="To" aria-describedby="basic-addon1">
          </div>
        </div>
        <br>
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save</button>
      </div>
    </div>
  </div>
</div>


我认为,这是由<span>标记之前的<input>标记引起的。让我们尝试上面的代码,改用引导程序输入。
结果:

关于css - 模态窗口中的Bootstrap表单样式,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/42777866/

10-10 01:39