I have an image in a bootstrap card in the second col. Everything looks fine on desktop but when im switching to phone i don't like how its looking.
<div class="mt-5 container card w-100">
<div class="row">
<div class="col">
<div class="card-body">
<h4 class="card-title">Card-title</h4>
<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="card-link">Card link</a>
</div>
</div>
<div class="col">
<img class="img-fluid img-responsive" src="trees.jpg">
</div>
</div>
</div>
The image looks like this when viewed on phone and dekstop: https://imgur.com/a/9afhvil
can someone help me with this?
For responsive you need to use col-sm
, col-md
, col-lg
, col-xl
. You can refer through w3schools for Bootstrap grid
<div class="mt-5 container card w-100">
<div class="row">
<div class="col-sm-6">
<div class="card-body">
<h4 class="card-title">Card-title</h4>
<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="card-link">Card link</a>
</div>
</div>
<div class="col-sm-6">
<img class="img-fluid img-responsive" src="trees.jpg">
</div>
</div>
</div>
@johannes Glad that I could help you. Please upvote and accept my answer if you feel that was helpful. Happy coding :)