I have images of different sizes and x/y ratios in a responsive CSS grid. I need a ✖️ button in the top-right corner of each image. So in each grid cell I put a form, and inside the form - a button and an image:
<form action="/destroyImage" method="POST">
  <button type="submit" class="close">
    <span>×</span>
  </button>
  <img src="/pub/myimage123.jpg"/>
</form>
The questions:
To get the 'X' in the top right hand corner you could do:
.AClass{
    right:0px;
    position: absolute;
}
<form action="/destroyImage" method="POST">
    <div style="position:relative;">
        <button type="submit" class="close AClass">
           <span>×</span>
        </button>
        <img src="/pub/myimage123.jpg"/>
    </div>
</form>
To get a better cross I would suggest using Font Awesome or some variant of that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With