¿Cual es mi problema? Bueno pues no cubre todo el cuerpo o la pantalla.
What is my problem? Well, it doesn’t cover the whole body or screen.
HTML:
<div class="Cargando" id="Cargando">
<img src="Imagenes/Logo_500px.png"/>
<div class="precargando">
<p>Cargando</p>
</div>
<script type="text/javascript" src="JS/Pantalla_Cargando.js"></script>
</div>`
CSS:
* {
padding: 0;
margin: 0;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-o-box-sizing: border-box;
}
.Cargando>img {
z-index: 500;
position: absolute;
top: 8%;
width: 26%;
height: 225px;
left: 37%;
}
.Cargando>.precargando>p {
z-index: 500;
color: black;
font-size: 28px;
}
.Cargando {
z-index: 500;
top: 0;
position: absolute;
background: #222;
color: #fff;
width: 100%;
height: 100%;
max-width: 100%;
display: flex;
}
.precargando {
z-index: 500;
margin: auto;
width: 350px;
height: 30px;
background: rgba(255, 255, 255, 0.1);
position: relative;
}
.precargando:before {
z-index: 500;
content: "";
position: absolute;
background: green;
width: 0;
height: 30px;
animation: precargando 10s infinite;
}
.precargando>p {
z-index: 500;
margin: 0;
line-height: 30px;
font-size: 25px;
font-weight: bold;
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.cerrar {
transform: translateY(-100%);
transition: all 0.5s;
}
@keyframes precargando {
90% {
width: 100%;
opacity: 1;
}
100% {
width: 100%;
opacity: 0;
}
}
JS:
var Cargando = document.getElementById('Cargando');
setTimeout(function() {
Cargando.classList.add('cerrar');
}, 9000)