How to create a preloader using Html & CSS.



Hello friends, today we will be going to how do we Create A Preloader Using Html & CSS. I have posted many videos and articles before related to the JavaScript project, now this the something new that we are going to build.

Video Tutorial of How To Create A Preloader Using Html & CSS


As you have seen on the given video tutorial of  How To Create A Preloader Using Html & CSS, 

If you are feeling bored watching the given video tutorial of How To Create A Preloader Using Html & CSS then you can copy or download the given codes below:


How To Create A Preloader Using Html & CSS | Free Source Code

To create this program (Preloader). First, you need to create two Files one HTML File and another one is CSS File. After creating these files just paste the following codes in your file.

In the first place, make a HTML document with the name of index.html and glue the given codes in your HTML record. Keep in mind, you've to make a document with .html extension.
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>Loader Animation</title>
</head>
<body onload="myFunction()">
    <div class="loader-wrapper" id="loader">
        <div class="loader">
            <span style="--i:1"></span>
            <span style="--i:2"></span>
            <span style="--i:3"></span>
        </div>
    </div>
    <iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/zd7KqEioHjg" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
    <script>
        var preloader = document.getElementById('loader');

        function myFunction(){
            preloader.style.display = 'none'
        }
    </script>
</body>
</html>
Second, make a CSS record with the name of style.css and glue the given codes in your CSS document. Keep in mind, you've to make a record with .css extension.
*
{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body
{
    font-family: sans-serif;
}
.loader-wrapper 
{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    min-height: 100vh;

}
.loader
{
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    transform: rotate(175deg);
}
.loader span
{
    position: absolute;
    top: calc(12px * var(--i));
    left: calc(12px * var(--i));
    right: calc(12px * var(--i));
    bottom: calc(12px * var(--i));
    border: 3px solid transparent;
    border-radius: 50%;
    border-left-color: rgb(98, 0, 255);
    animation: animate 1s linear infinite;
    filter: hue-rotate(calc(60deg * var(--i)));
    animation-delay: calc(-0.1s * var(--i));
}
.loader span:nth-child(1)
{
    
    animation-duration: 2s;
}
.loader span:nth-child(2)
{
    animation-duration: 1s;
}
.loader span:nth-child(3)
{
    animation-duration: 0.5s;
}
@keyframes animate
{
    0%
    {
        transform: rotate(0deg);
    }
    100%
    {
        transform: rotate(360deg);
    }
}
That’s all, now you’ve successfully created a program to How To Create A Preloader Using Html & CSS. If your code doesn’t work or you’ve faced any error/problem, please download the source code files from the given download button. It’s free and a .zip file will be downloaded then you’ve to extract it.
Click on the following download button to download all source code files.


Download Now
Please Wait...
Direct Link click here.

How can I help you

Post a Comment

How can I help you

Post a Comment (0)

Previous Post Next Post