Link on Image in Bootstrap


Topic: Link on Image in Bootstrap

Jones pro asked 6 years ago

I just purchased MDB....not sure how to use it, but I will go through the tutorials and figure it out... seems cool. But I have a quick probably obvious question.  I have an image that I want to add a link to when clicked...how do I do that in Bootstrap 4

Try this:
<a href="www.test.com">
<img src="google-play-badge.svg" style="height: 60px;"/>
</a>


Marta Szymanska staff pro premium answered 6 years ago

Hi, try this code:
<!--Grid row-->
<div class="row">

<!--Grid column-->
<div class="col-lg-3 col-md-6">

<!-- Card image -->
<div class="view overlay">
<img class="img-fluid" src="https://mdbootstrap.com/img/Mockups/Lightbox/Thumbnail/img%20(67).jpg" alt="Card image cap">
<a href="https://www.google.com/">
<div class="mask rgba-white-slight"></div>
</a>
</div>

</div>
<!--Grid column-->
</div>
<!--Grid row-->
Best, Marta
Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No