"overlay , center text in image"
Bootstrap 4.0.0 Snippet by mhk67_

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <div class="col-md-4 mt-3 cat-fav"> <div class="card text-white "> <img class="card-img" src="https://www.w3schools.com/howto/img_fjords_wide.jpg" alt="Card image"> <div class="card-img-overlay"> <h5 class="card-title centered">ابزار آلات</h5> </div> </div> </div><!--.col--> <div class="col-md-4 mt-3 cat-fav"> <div class="card text-white "> <img class="card-img" src="https://www.w3schools.com/howto/img_fjords_wide.jpg" alt="Card image"> <div class="card-img-overlay"> <h5 class="card-title centered">ابزار آلات</h5> </div> </div> </div><!--.col--> <div class="col-md-4 mt-3 cat-fav"> <div class="card text-white "> <img class="card-img" src="https://www.w3schools.com/howto/img_fjords_wide.jpg" alt="Card image"> <div class="card-img-overlay"> <h5 class="card-title centered">ابزار آلات</h5> </div> </div> </div><!--.col--> <div class="col-md-4 mt-3 cat-fav"> <div class="card text-white "> <img class="card-img" src="https://www.w3schools.com/howto/img_fjords_wide.jpg" alt="Card image"> <div class="card-img-overlay"> <h5 class="card-title centered">ابزار آلات</h5> </div> </div> </div><!--.col--> <div class="col-md-4 mt-3 cat-fav"> <div class="card text-white "> <img class="card-img" src="https://www.w3schools.com/howto/img_fjords_wide.jpg" alt="Card image"> <div class="card-img-overlay"> <h5 class="card-title centered">ابزار آلات</h5> </div> </div> </div><!--.col--> <div class="col-md-4 mt-3 cat-fav"> <div class="card text-white "> <img class="card-img" src="https://www.w3schools.com/howto/img_fjords_wide.jpg" alt="Card image"> <div class="card-img-overlay"> <h5 class="card-title centered">ابزار آلات</h5> </div> </div> </div><!--.col--> </div> </div>
.cat-fav .card{ position: relative; } .centered { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }

Related: See More


Questions / Comments: