【问题标题】:What is the '.well' equivalent class in Bootstrap 4Bootstrap 4中的“.well”等效类是什么
【发布时间】:2016-12-01 22:09:27
【问题描述】:

在 bootstrap-3 中有 .well 类,它在元素周围添加一个圆形边框,具有灰色背景颜色和一些填充。

<div class="well">Basic Well</div>

但是,我在 bootstrap-4 中没有找到任何 .well 类。 bootstrap-4中是否有与.well等价的标签?

【问题讨论】:

标签: css twitter-bootstrap twitter-bootstrap-3 bootstrap-4 twitter-bootstrap-4


【解决方案1】:

2018 年更新...

card 已替换 well

引导程序 4

<div class="card card-body bg-light">
     Well
</div>

,作为两个DIV...

<div class="card bg-light">
    <div class="card-body">
        ...
    </div>
</div>

(注意:在 Bootstrap 4 Alpha 中,这些被称为 card-block 而不是 card-bodybg-faded 而不是 bg-light

http://codeply.com/go/rW2d0qxx08

【讨论】:

    【解决方案2】:

    Wells 使用 version 4 从 Bootstrap 中删除。

    您可以使用Cards 代替 Wells。

    以下是如何使用新卡片功能的简单示例:

    <div class="card card-inverse" style="background-color: #333; border-color: #333;">
      <div class="card-block">
        <h3 class="card-title">Card Title</h3>
        <p class="card-text">This text will be written on a grey background inside a Card.</p>
        <a href="#" class="btn btn-primary">This is a Button</a>
      </div>
    </div>
    

    【讨论】:

      【解决方案3】:

      这对我来说效果最好:

      <div class="card bg-light p-3">
       <p class="mb-0">Some text here</p>
      </div>
      

      【讨论】:

        【解决方案4】:

        似乎没有一个答案适用于按钮。引导程序 v4.1.1

        <div class="card bg-light">
            <div class="card-body">
                <button type="submit" class="btn btn-primary">
                    Save
                </button>
                <a href="/" class="btn btn-secondary">
                    Cancel
                </a>
            </div>
        </div>
        

        【讨论】:

        • 如此真实!我可以确认您需要将单独的卡体类附加到其自己的 div 以使按钮正常显示!
        【解决方案5】:

        当然officially version 说这些卡是 Bootstrap 井的新替代品。但是 Cards 现在是一个相当广泛的 Bootstrap 组件。简单来说,你也可以使用Bootstrap Jumbotron

        【讨论】:

          【解决方案6】:

          寻找单行选项:

              <div class="jumbotron bg-dark"> got a team? </div>        
          

          https://getbootstrap.com/docs/4.0/components/jumbotron/

          【讨论】:

            【解决方案7】:

            我正在为班级警报做好我的班级,对我来说它看起来越来越好,但有时需要进行一些调整以将宽度设置为 100%

            <div class="alert alert-light" style="width:100%;">
              <strong>Heads up!</strong> This <a href="#" class="alert-link">alert needs your attention</a>, but it's not super important.
            </div>
            

            【讨论】:

              【解决方案8】:

              卡似乎被“丢弃”了哈哈,我发现“好”不适用于 bootstrap 4.3.1 和 jQuery v3.4.1,但在 bootstrap 4.3.1 和 jQuery v3.3.1上工作正常>。希望对您有所帮助。

              【讨论】:

                猜你喜欢
                • 1970-01-01
                • 2018-09-23
                • 1970-01-01
                • 1970-01-01
                • 2021-11-22
                • 2018-01-06
                • 2017-05-25
                • 2018-02-20
                相关资源
                最近更新 更多