Thursday, January 17, 2019

Awesome Loading Screen Using Html & CSS Only || TR WEB SCHOOL #2

Awesome loading screen using css3 and html5 #2 || Html Tutorials

For learning Html and CSS or any type of coding you must play with the code.

Here in this tutorial you will learn how to create a awesome loading screen animation using Html and CSS.

Steps to be followed:-


  1. Create a div with a class and name the class what you like i am giving it name as center
  2. Now create 8 div tag inside the above div tag with class bar and bar1, bar2, bar3 utpo bar8 or even more if  you like
  3. Now it's time for css... Reset the css body by margin 0
  4. Now align div in middle of the display
  5. Now provide the dimensions and background to the bars
  6. Provide the keyframes for animation
  7. Set the time delay to every bar to make it look like loading screen.

Html Code:-



  <div class="center">  
       <div class="bar bar1"></div>  
       <div class="bar bar2"></div>  
       <div class="bar bar3"></div>  
       <div class="bar bar4"></div>  
       <div class="bar bar5"></div>  
       <div class="bar bar6"></div>  
       <div class="bar bar7"></div>  
       <div class="bar bar8"></div>  
     </div>  

CSS Code:-


 body{  
   margin: 0;  
   padding: 0;  
   background-color: #00456e;  
 }  
 .center{  
   position: absolute;  
   top: 50%;  
   left: 50%;  
   transform: translate(-50%, -50%);  
 }  
 .bar{  
   width: 6px;  
   height: 60px;  
   background: #fff;  
   display: inline-block;  
   animation: loading 1.2s ease-in infinite;  
   transform-origin: bottom center;  
 }  
 .bar1{  
   animation-delay: 0.1s;  
 }  
 .bar2{  
   animation-delay: 0.2s;  
 }  
 .bar3{  
   animation-delay: 0.3s;  
 }  
 .bar4{  
   animation-delay: 0.4s;  
 }  
 .bar5{  
   animation-delay: 0.5s;  
 }  
 .bar6{  
   animation-delay: 0.6s;  
 }  
 .bar7{  
   animation-delay: 0.7s;  
 }  
 .bar8{  
   animation-delay: 0.8s;  
 }  
 @keyframes loading{  
   0%{  
     transform: scaleY(0.1);  
     background: #ccc;  
   }  
   50%{  
     transform: scaleY(1);  
     background: #fff;  
   }  
   100%{  
     transform: scaleY(0.1);  
     background: #ccc;  
   }  
 }  


Video Tutorial




If you like our tutorial please don't forgot to subscribe to our channel.
Disqus Comments