Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how to put <a> tag at top right corner of card with bootstrap?

I have card which has image in background

  <div class="col-12 col-sm-8 col-md-6 col-lg-4 mt-4">
    <div class="card">

      <img class="card-img" style=" filter: brightness(75%);" src="{{$category->photo}}">
      <div class="card-img-overlay text-white d-flex flex-column justify-content-center">
        <a class="text-right"><i class="fas fa-pen"></i></a>
        <h1 class="card-title text-white text-center ">{{$category->name}}</h1>
      </div>
    </div>
  </div>

There is pen icon which I want to put on top right corner

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Try out the position utility classes.

https://getbootstrap.com/docs/5.1/utilities/position/

For example:

<div class="card position-relative">
  <!-- other elements -->
  <a class="text-right position-absolute top-0 end-0"><i class="fas fa-pen"></i></a>
</div>

Learn more about CSS position: https://developer.mozilla.org/en-US/docs/Web/CSS/position

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading