zoukankan      html  css  js  c++  java
  • BootStrap modal() 如何根据返回的HTML宽度自动调整宽度?

    首先声明,如果真的这么做了也就失去了 bootstrap 多分辨率适配的好处。bootstrap 的 modal 窗口能够自动在不同分辨率下用不同的宽度,这就是它的特色呢。

    以默认大小的 modal 为例,要做改变宽度其实只需要在 .modal-dialog 样式上做文章就行了。为了简单,我现在直接写在元素标签上了。

    关键三点:

    • 用 display: inline-block
    • 父节点用 text-center 样式居中;
    • 重置宽度  auto

    HTML 代码:

    <div id="dialog" class="modal fade text-center">
      <div class="modal-dialog" style="display: inline-block;  auto;">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title">Modal title</h4>
          </div>
          <div class="modal-body">
            <p>One fine body&hellip;</p>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            <button type="button" class="btn btn-primary">Save changes</button>
          </div>
        </div>
      </div>                                                                                                                                                                                                                                      
    </div>
    <script
    

     

     
     
    http://segmentfault.com/q/1010000000594810
  • 相关阅读:
    shell 默认变量
    diff 实现
    AWK变量
    docker-bridge network
    docker--linux network namespace
    docker-container 操作
    docker--shell和Exec格式
    docker--build自己的image
    docker--container
    docker--删除container和image
  • 原文地址:https://www.cnblogs.com/chen110xi/p/5115240.html
Copyright © 2011-2022 走看看