The card-img-top
class already makes the images expand to use the full size in the card; if the cards all have the same width you shouldn't have any issues; that is if you use the same markup structure defined in Bootstrap docs.
Here I have used images of multiple sizes and you can see all cards images display the same; maybe this can help you a bit
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" />
<div class="d-flex">
<div class="card" style="width: 18rem;">
<img src="https://via.placeholder.com/150" class="card-img-top" alt="...">
<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" style="width: 18rem;">
<img src="https://via.placeholder.com/100" class="card-img-top" alt="...">
<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" style="width: 18rem;">
<img src="https://via.placeholder.com/250" class="card-img-top" alt="...">
<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>
Here is also the same example using the code you provided, I just made sure that your columns are wrapped inside a .row
div; remember that's required in Bootstrap. You can also remove the style
attribute, you shouldn't use that to alter the styles already applied by the classes.
I also don't know what the card-block
is supposed to be; in any case Bootstrap has the .card-body
class that's supposed to hold the content of the card
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" />
<div class="row">
<div class="col-md-6 col-lg-3">
<div class="card">
<img src="https://via.placeholder.com/100" alt="bootstrap" class="card-img-top ">
<div class="card-block">
<h3 class="card-title"> Projects </h3>
<p> hello world hello worldhello worldhello worldhello worldhello world
</p>
</div>
</div>
</div>
<!-- card 3-->
<div class="col-md-6 col-lg-3">
<div class="card">
<img src="https://via.placeholder.com/150" alt="HTML" class="card-img-top ">
<div class="card-block">
<h3 class="card-title"> Projects </h3>
<p> hello world hello worldhello worldhello worldhello worldhello world
</p>
</div>
</div>
</div>
</div>
</div>
Projects
hello world hello worldhello worldhello worldhello worldhello world