I'm looking to create a banner that adjusts appropriately for mobile and desktop display. Here's what I've tried:
When it is displayed in mobile
When it is displayed in desktop
In my attempt, the text alignment was off even though I used float-right:
.card-body {
display: flex;
}
@media(min-width:768px) {
.card-title {
font-size: 3vw;
word-break: break-all;
}
}
@media(max-width:767px) {
.card-title {
font-size: 8.5vw;
word-break: break-all;
}
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<div class="shadow card col-md-3 ml-4 mt-3 mb-3 mr-4" style="background-color: #F0E78C">
<div class="row">
<div class="card-body col-12 border p-0">
<img src="https://i.imgur.com/ZyROdEa.png" width="90">
<h5 class="card-title float-right">9999999999</h5>
</div>
<div class="card-body col-12 border p-0">
<a href="" class="btn btn-block" style="background-color: #00BFFF; color: white;">Get Details</a>
</div>
</div>
</div>