css 在Bootstrap(5.3版)中,当我从示例中复制我的特征时,为什么没有复制背景?

zf9nrax1  于 4个月前  发布在  Bootstrap
关注(0)|答案(1)|浏览(97)

今天,当我在一个网站上使用bootstrap时,我从bootstrap部分的示例中复制了功能。然后当我将代码保存在我的编码平台中时,背景是透明的,为什么没有背景?
我希望得到一个背景沿着的代码,使功能不会是透明的
这是我的代码:

<div class="container px-4 py-5" id="featured-3">
      <h2 class="pb-2 border-bottom">Why Choose Us?</h2>
      <div class="row g-4 py-5 row-cols-1 row-cols-lg-3">
        <div class="feature col">
          <div class="feature-icon d-inline-flex align-items-center justify-content-center text-bg-primary bg-gradient fs-2 mb-3">
            <svg class="bi" width="1em" height="1em"><use xlink:href="#collection"></use></svg>
          </div>
          <h3 class="fs-2 text-body-emphasis">Easy to Use</h3>
          <p>So easy to use, that even your dog could do it.</p>

        </div>
        <div class="feature col">
          <div class="feature-icon d-inline-flex align-items-center justify-content-center text-bg-primary bg-gradient fs-2 mb-3">
            <svg class="bi" width="1em" height="1em"><use xlink:href="#people-circle"></use></svg>
          </div>
          <h3 class="fs-2 text-body-emphasis">Elite Clientele</h3>
          <p>We have all the dogs, the greatest dogs.</p>

        </div>
        <div class="feature col">
          <div class="feature-icon d-inline-flex align-items-center justify-content-center text-bg-primary bg-gradient fs-2 mb-3">
            <svg class="bi" width="1em" height="1em"><use xlink:href="#toggles2"></use></svg>
          </div>
          <h3 class="fs-2 text-body-emphasis">Guaranteed to work</h3>
          <p>Find the love of your dog's life or your money back. </p>

        </div>
      </div>
    </div>

字符串

wsxa1bj1

wsxa1bj11#

我想你可能已经复制了基于每个组件的Bootstrap官方文档的例子,很多时候bootstrap没有定义触发默认颜色的背景颜色,默认颜色是白色或灰色等,可能是你也想看看这个bootstrap文档关于bootstrap中的背景颜色和如何添加它。希望这对你有帮助。
欢迎来到StackOverlflow,详细阐述并提供更多细节,下次您提出任何问题时。

相关问题