0
I’m creating a pop-up window in CSS
, but the close button is not inside the element where it displays the advertisement in the pop-up. The button is in the far left corner of the site.
Note below my pop-up, you’re right. However, check the top left corner of the site (X) to close the pop-up advertisement.
How to make the close button stay located in the top right corner of the pop-up?
HTML
<figure class="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;
}
you are using Bootstrap ?
– Thiago Friedman
@Thiagofriedman no! Css only.
– Gladison
Maybe this jsFiddle help you get the expected result.
– Mathiasfc
@Gladison I advise you to use Bootstrap modal, simpler and more efficient, here’s an example, https://stackoverflow.com/questions/13183630/how-to-open-a-bootstrap-modal-window-using-jquery
– Thiago Friedman
@Mathiasfalci I prefer to adjust this code I use.
– Gladison