【问题标题】:Simplest way to create a modal window for a single image that resizes with screen size?为随屏幕大小调整大小的单个图像创建模式窗口的最简单方法?
【发布时间】:2023-03-03 00:48:02
【问题描述】:

我正在使用 Bootstrap 3.3.7,想知道如何为单个图像实现模态窗口。我试图仅使用内联样式来简化流程。

【问题讨论】:

    标签: html twitter-bootstrap


    【解决方案1】:

    感谢How to make Twitter bootstrap modal full screen,你可以这样做:

    .modal-dialog {
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 0;
    }
    
    .modal-content {
      height: auto;
      min-height: 100%;
      border-radius: 0;
    }
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
    
    <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-body">
        Image here
      </div>
    </div>

    【讨论】:

    • 我应该像 或其他方式插入我的图像吗?我做了前面提到的,但我的图片根本没有出现在我的网页上。是的,图像在我的目录中。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多