How do I center a Bootstrap Card Image [duplicate]

我只是一个虾纸丫 提交于 2019-12-10 18:08:30

问题


How do I center an image in a Bootstrap 4 card? It's a vertical image and it looks wrong being left-aligned. I've been reading the Bootstrap Card documentation and can't find anything about centering the image.

<div class="card-deck">
  <div class="card col-sm-3">
    <div>
      <img class="card-img-top" src="image_URL" alt="alt-text" >
      <div class="card-block">
        <div class="card-text">
            text
        </div>
      </div>
    </div>
  </div>

来源:https://stackoverflow.com/questions/44914373/how-do-i-center-a-bootstrap-card-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!