【问题标题】:Modal Box - Show only the inside of the box模态框 - 仅显示框的内部
【发布时间】:2021-10-04 17:54:23
【问题描述】:

我正在尝试做一个模态框,它只显示“内部”。

现在我看到了这个:Screenshot

但我想看看这个:Screenshot

代码:

<div class="modal-content">
    <div class="modal-body">
        <p>Text1................................</p>
        <p>Text2................................</p>
    </div>
    <div class="modal-footer" style="float:right;">
        <button class="next-button"><i class="fa fa-angle-right"></i></button>
    </div>
</div>

<style>
    .close {
        display:none;
    }

    .next-button:active {
        outline: none;
        border: none;
    }

    .next-button:focus {
        outline: none;
        border: none;
    }

    .next-button:after {
        outline: none;
        border: none;
    }
</style>

所以,我想删除细灰色边框之外的所有内容 - 空白和十字。 谁能告诉我,这是如何实现的?谢谢

编辑: 我选择了另一种解决方案,它没有使用 javascript,让它变得更加简单: https://gist.github.com/conficient/ba98d1662c659e170ec16650acea05c8

【问题讨论】:

  • 请分享我们的css代码
  • @Andrew 当然,但它几乎没有包含任何内容。我已经更新了问题
  • 你使用的是引导程序,对吧?
  • @kalgoritmi 是的,我是
  • 分享你的代码

标签: html modal-dialog


【解决方案1】:

据我了解,你想要这样的东西:

示例:JsFiddle

代码:

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

<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
     <div class="modal-body">
        <p>Text1................................</p>
        <p>Text2................................</p>
    </div>
    <div class="modal-footer" style="float:right;">
        <button class="next-button"><i class="fa fa-angle-right"></i></button>
    </div>
    </div>
  </div>

UPD:

CSS:

.next-button {
  background-color: transparent;
  background-repeat: no-repeat;
  border: none;
  cursor: pointer;
  overflow: hidden;
  outline: none;
}

或者为了隐藏X你可以提供下一个代码:

.modal-header .btn-close {
 display: none !important;
}

【讨论】:

  • 是的,这正是我想要的样子。但不知何故,它对我来说看起来像这样,即使我几乎复制粘贴了你的解决方案:Screenshot
  • @Palle 尝试使用新版本的 Bootstrap,在资源中的 jsfiddle 中你可以看到我使用的所有链接
  • @Palle 并尝试 Ctrl+F5,出于某种原因它会有所帮助
  • 我从您发布的 jsfiddle 更新了引导程序,并使用了 ctrl + f5,但不幸的是,这对我没有用
  • @Palle 请用你的代码创建 JSfiddle,我会检查有什么问题。
猜你喜欢
  • 1970-01-01
  • 2020-03-26
  • 2020-09-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-10-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多