水平卡并排html bootstrap

时间:2019-03-07 20:56:47

标签: html css bootstrap-4

如何实现相邻的2张水平(行)卡?这是我到目前为止的代码,当我复制n粘贴它时,卡片碰撞n变得一团糟。

我需要这样的卡片并排

enter image description here

<div class="card-body p-0 d-flex justify-content-around flex-wrap">
        <div class="col-md-3 ">
            <div class="card card-style1">

                <div class="card-header s-2">
                    <h3 class="card-title">Data </h3>
                </div>

     <div class="card-body d-flex justify-content-center" style="overflow-y: auto; list-style-type:none;">
                    <table class="data-info-table">
                        <tr data-toggle="tooltip" data-placement="left" title="Data Name">
                            <td><i class="fas fa-user "></i></td>
                            <td><textarea class="form-control asd" id="client" rows="1"  type="text" style="resize: none; overflow-y: auto;"></textarea>
                            </td>
                        </tr>

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

    </div>

1 个答案:

答案 0 :(得分:0)

直接从Bootstrap Card复制。我刚刚为两张卡添加了一个新的父类,其类为class =“ row”和col-6。

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" />

<div class="row col-12">
  <div class="card col-6">
    <img class="card-img-top" src="https://images.pexels.com/photos/20787/pexels-photo.jpg?cs=srgb&dl=adorable-animal-cat-20787.jpg&fm=jpg" alt="Card image cap">
    <div class="card-body">
      <h5 class="card-title">Card title</h5>
      <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
      <a href="#" class="btn btn-primary">Go somewhere</a>
    </div>
  </div>

  <div class="card col-6">
    <img class="card-img-top" src="https://images.pexels.com/photos/20787/pexels-photo.jpg?cs=srgb&dl=adorable-animal-cat-20787.jpg&fm=jpg" alt="Card image cap">
    <div class="card-body">
      <h5 class="card-title">Card title</h5>
      <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
      <a href="#" class="btn btn-primary">Go somewhere</a>
    </div>
  </div>
</div>