首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使内容为中心-在引导卡?

如何使内容为中心-在引导卡?
EN

Stack Overflow用户
提问于 2020-01-26 12:01:22
回答 1查看 28关注 0票数 0

我想把内容集中在这张卡片上

代码语言:javascript
复制
<!-- Card -->
<div class="card card-image h-80" style="background-color:grey;">

  <!-- Content -->
  <div class="text-white text-center d-flex align-items-center rgba-black-strong py-5 px-4 justify-content">
    <div>
      <h5 class="pink-text"><i class="fas fa-chart-pie"></i> Your Holdings</h5>
      <br>
      <br>
      <h3 class="card-title pt-2"><strong id="snet-holding">0 </strong> SNET</h3>
      <h4 class="card-title pt-2"><strong id="usd-value">0 </strong> USD</h4>

      <br>

    </div>
  </div>

</div>
<!-- Card -->

    </div>

但出于某种原因,卡内的内容集只有在卡内有值时才会集中。但是如果里面没有内容的话,我也需要以它为中心。当图像处于这种状态时,我需要以内容为中心。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-01-27 09:12:48

应该有justify-content-center类而不是justify-content类。新代码是

代码语言:javascript
复制
<div class="card card-image h-80" style="background-color:grey;">

  <!-- Content -->
  <div class="text-white text-center d-flex align-items-center rgba-black-strong py-5 px-4 justify-content-center">
    <div>
      <h5 class="pink-text"><i class="fas fa-chart-pie" aria-hidden="true"></i> Your Holdings</h5>
      <br>
      <br>
      <h3 class="card-title pt-2"><strong id="snet-holding">0 </strong> SNET</h3>
      <h4 class="card-title pt-2"><strong id="usd-value">0 </strong> USD</h4>

      <br>

    </div>
  </div>

</div>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59918110

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档