简体   繁体   中英

horizontal cards side by side html bootstrap

How to achieve 2 horizontal(row) cards next to each other? This is my code i have so far, when i copy n paste it the cards collide n become a mess.

i need the cards to be side by side like this

在此处输入图片说明

<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>

Copied directly from Bootstrap Card . I just added a new parent div with class="row" and col-6 for both cards.

 <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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM