« Helping each other Forum

(FIXED)I can't get my code for a loading sreen to work, HELPP

Posted by n0ah

posted
updated

Forum: Helping each other

I've been trying to get this code to work for ages. Nothing is helping.

Please tell me what I'm doing wrong and how to fix it.

Here is the code:



<style>

@keyframes loading {

 0% {opacity: 1;}

 50% {opacity: 1;}

 100% {opacity: 0;}

}


body:before {

 content: " ";

 height: 100vh;

 width: 100vw;

 display: block;

 position: fixed;

 top: 0;

 left: 0;

 z-index: 99999;

 backgroung image: url("https://media.tenor.com/PPXvHwXGsVYAAAAM/baguerer-vt.gif");

 background-size:cover;

 background-repeat: no-repeat;

 backgroung-position: center;

 animation: loading 3s ease 0s 1 normal forwards;

 pointer-events: none;

 pointer-events: none;

 filter: grayscale(100%);

}

</style>



Report Topic

2 Replies

Sort Replies:

Reply by ⛤⃝ Devil_Advocate

posted

The error was due to typos in the CSS you wrote try now see if it works. 


<style>

@keyframes loading {

  0% { opacity: 1; }

  50% { opacity: 1; }

  100% { opacity: 0; visibility: hidden; }

}


body::before {

  content: "";

  height: 100vh;

  width: 100vw;

  display: block;

  position: fixed;

  top: 0;

  left: 0;

  z-index: 99999;

  background-image: url("https://media.tenor.com/PPXvHwXGsVYAAAAM/baguerer-vt.gif");

  background-size: cover;

  background-repeat: no-repeat;

  background-position: center;

  animation: loading 3s ease 0s 1 normal forwards;

  pointer-events: none;

  filter: grayscale(100%);

}

</style>



Permalink Report Reply

Reply by n0ah

posted

Thanks, it worked


Permalink Report Reply