I have a collection of images with varying sizes and ratios in a responsive CSS grid layout. Each image needs to have a close button located at the top-right corner. To achieve this, I have inserted a form within each grid cell with a button and an image inside:
<form action="/destroyImage" method="POST">
<button type="submit" class="close ">
<span>×</span>
</button>
<img src="/pub/myimage123.jpg"/>
</form>
My questions are:
- How can I align the center of the button perfectly with the corner of the image?
- What is the best way to style the close button for a more visually appealing appearance (I am using Bootstrap 4)?