How To Create Animated Loader Ring Using Html and Css

admin_img Posted By Bajarangi soft , Posted On 08-10-2020

The Loader Ring can be easily generated using HTML and CSS. The Loader Ring displays when the browsers are loading web pages. To create a loader ring, we will make the use of CSS animations that allows animation of HTML elements.

Animated Loader Html

HTML Code is used to create a basic structure of the animated loader ring and CSS code is used to set the style of Loader Ring.
We will use the @keyframes rule that allows the animation to gradually change from current style to the new style at certain times then we will use the transform property to
rotate the animation 360 degrees.


Example

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>
        How to Create Animated Loader
        Ring using HTML and CSS?
    </title>

    <style>
        body {
            margin: 0;
            padding: 0;
            background: #dca925;
        }

        .circle {
            position: absolute;
            top: 40%;
            left: 50%;
            transform: translate(-40%, -50%);
            animation: effect 1s linear infinite;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            border: 6px solid rgba(255, 255, 255, 0.3);
            border-top-color: #fff;
        }

        @keyframes effect {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }

        }
    </style>
</head>

<body>
<div class="circle"></div>
</body>

</html>

Related Post