I'm creating a pop-up window in CSS
, but the close button is not within the element where the advertisement is displayed in the pop-up. The button is in the far left corner of the site.
Look below my popup, you're right. However, look at the upper left corner of the site (X) to close the pop-up advertisement.
How to make the close button stay in the upper right corner of the popup?
HTML
<figureclass="pop-up-principal">
<span id="close">×</span>
<img src="./imagens-pop-up/drbrunomachado.jpg">
</figure>
CSS
figure.pop-up-principal img{
position: fixed;
width: 100%;
max-width: 378px;
max-height: 283px;
margin: 0 auto;
top: 0;
bottom: 0;
left: 0;
right: 0;
text-align: center;
background: white;
border-radius: 10px;
border: 5px solid #9AD3DE;
box-sizing: border-box;
z-index: 9999;
}
#close{
position: fixed;
float: right;
width: 25px;
height: 25px;
line-height: 25px;
font-size: 25px;
border-radius: 50%;
color: #EF5350;
border:2px solid #EF9A9A;
}