I have two divs : image_cancelling and image_loading.
I want the canceling image to be in the middle of the screen , centered both vertically and horizontally, and that image_loading is below image_cancelling , also centered horizontally, with a separation of 5 line breaks compared to the first div
.
Why are not the elements centered?
* {
margin: 0;
padding: 0;
font-family: sans-serif;
box-sizing: border-box;
}
body {
display: flex;
min-height: 100vh;
background-repeat: no-repeat;
background-size: 100%;
}
#imagen_cancelando{
position: absolute;
top: 50%;
left: 50%;
}
#imagen_cancelando + #imagen_cargando{
margin-top: 5em;
}
<!DOCTYPE html>
<html lang="es">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Cancelando pago</title>
<link rel="stylesheet" href="css/cancelando.css">
</head>
<body background="imagenes/fondo_campo4.jpg">
<div id="imagen_cancelando">
<img src="imagenes/cancelado.png" alt="cancelando"/>
</div>
<div id="imagen_cargando">
<center><img src="imagenes/cargando.gif" alt="cargando" height="20px" width="20px"/></center>
</div>
</body>
</html>