I am currently working on my web portfolio and I am looking to create a card format that includes an image thumbnail with text below it. However, I am facing an issue where I cannot control the size of the initial image, resulting in misaligned cards.
https://i.sstatic.net/sWFKH.png
Is there a way to fix this so that the card adjusts to any image size? Here is the code snippet:
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.14.0/css/all.css">
<title>Pattern</title>
</head>
<body>
<nav class="navbar bg-dark navbar-dark">
<div class="container">
<a href="" class="navbar-brand"> <i class="fas fa-code"></i> BODY OF WORK</a>
</div>
</nav>
<section id="header" class="jumbotron text-center">
<h1 class="display-3">FRANK DIN: WEB DEVELOPER</h1>
</section>
<section id="gallery">
<div class="container">
<div class="row">
<div class="col-lg 4 mb-3">
<div class="card">
<a href=""><img class="card-img-top" src="https://github.com/frankdin1/LandingPage/blob/master/Landing%20Page%20thumbnail.PNG?raw=true"></a>
<div class="card-body">
<h5 class="card-title">Landing Page</h5>
<p class="card-text">Landing page for a fictitious dating site built with Bootstrap.</p>
<a href="https://github.com/frankdin1/LandingPage" class="btn btn-outline-primary">Github</a>
<a href="PurffectMatch.html" class="btn btn-outline-success">Webpage</a>
</div>
</div>
</div>
<div class="col-lg 4 mb-3">
<div class="card">
<a href=""><img class="card-img-top" src="https://github.com/frankdin1/Bootstrap-Image-Gallery/blob/master/BootstrapPhotoBlog%20thumbnail.PNG?raw=true"></a>
<div class="card-body">
<h5 class="card-title">Bootstrap Image Gallery</h5>
<p class="card-text">Image gallery built using Bootstrap.</p>
<a href="https://github.com/frankdin1/LandingPage" class="btn btn-outline-primary">Github</a>
<a href="PurffectMatch.html" class="btn btn-outline-success">Webpage</a>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin="anonymous"></script>
</body>
</html>