【问题标题】:How to show modal / panel in overlay HTML - CSS如何在覆盖 HTML 中显示模式/面板 - CSS
【发布时间】:2019-01-06 06:59:03
【问题描述】:

我想在 html / css 中显示此面板或模式,但我无法显示它,因为我有

<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.min.css">

当我删除该链接时,模态将显示,但当它存在时,模态不会显示。

P.S 我无法删除该链接,因为我的所有设计都将被删除或不可见,所以我如何在不删除该链接的情况下显示该模式,这是我的 css

style

      <style type="text/css">

body {
    /* general styles */
    padding: 30px;
    font-family: 'Open Sans', sans-serif;

}

/* overlay styles, all needed */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 10;
}

/* just some content with arbitrary styles for explanation purposes */
.modal {
    width: 300px;
    height: 200px;
    line-height: 200px;
    position: fixed;
    top: 50%; 
    left: 50%;
    margin-top: -100px;
    margin-left: -150px;
    background-color: #f1c40f;
    border-radius: 5px;
    text-align: center;
    z-index: 11; /* 1px higher than the overlay layer */
}

.content {
    margin: 30px;
}

h1 {
    font-family: 'Federo', sans-serif;
}
  </style>

我的div

     <div class="overlay"></div>
  <div class="modal" id="modal"><?php echo $row['id']; ?> <?php echo $row['additional_info']; ?></div>

【问题讨论】:

    标签: php html css twitter-bootstrap


    【解决方案1】:

    这不会显示对话框,因为 Bootstrap 也使用了 modal 类。

    如果您将&lt;div class="modal" id="modal"&gt; 行更改为&lt;div class="mymodal" id="modal"&gt;,您将看到它现在出现了。请务必同时更新您的 css 中的类名。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多