CSS Button to top-right corner of image (Gallery)
问题 I am trying to position a close button (x) to the top-right corner of an image. That's just before the footer of my page: <div class="modal" id="modal"> <span class="close" id="close">✖</span> <img class="modal-content" id="modal-content"> </div> How I show the modal: function showModal(name) { modal.style.display = "block"; modalImg.src = document.getElementById(name).src; } And here is my styling: /* Background when image is shown */ #modal { display: none; /* Hidden by default */ position: