Pure css+html Making Web page loading animation

Source: Internet
Author: User

We all know that the loading of the webpage takes a certain amount of time,

Even as we strive to optimize the efficiency of code execution and compress files,

But it still takes time, and if nothing happens on the surface during this period,

The user will have a worse experience,

But if there is an animation or a progress bar,

That's totally different.

This article shares the pure css+html loading animation code

The HTML code is as follows

<DivID= "Start-screen">        <Divclass= "In-start">            <Divclass= "First"></Div>            <Divclass= "Second"></Div>            <Divclass= "Third"></Div>        </Div>    </Div>

The CSS code is as follows:

HTML{Height:100%;}Body{Height:100%;}#start-screen{Height:100%;width:100%;Background-color:#ccc;Opacity:80%;position:fixed;Z-index:999;}. In-start{Height:50px;width:50px;position:Absolute;Margin-top:-45px;Margin-left:-25px;Top:50%; Left:50%;}. In-start. First,.in-start. Second,.in-start. Third{Height:25px;width:25px;position:Absolute;float: Left;Border-radius:50%;}. First{Background-color:#ff0;Animation:fir 1s linear 0.1s infinite;Top:0; Left:0;}. Second{Background-color:#0f0;Animation:sec 1s linear 0.2s infinite;Top:0; Left:25px;}. Third{Background-color:#00f;Animation:thi 1s linear 0s infinite;Top:25px; Left:0;}@keyframes Fir{0% {Top:0; Left:0; }25%{Top:25px; Left:0; }50%{Top:25px; Left:25px; }75%{Top:0px; Left:25px; }} @keyframes sec{0% {Top:0; Left:25px; }25%{Top:0; Left:0; }50%{Top:25px; Left:0; }75%{Top:25px; Left:25px; }} @keyframes Thi{0% {Top:25px; Left:0; }25%{Top:25px; Left:25px; }50%{Top:0; Left:25px; }75%{Top:0; Left:0; }}
View Code

HTML{Height: -%;}
Body{Height: -%;}
#start-screen{Height: -%;width: -%;Background-color:#ccc;Opacity: the%;position:fixed;Z-index:999;}
. In-start{Height: -px;width: -px;position:Absolute;Margin-top:-45px;Margin-left:-25px;Top: -%; Left: -%;}
. In-start . First,. In-start . Second,. In-start . Third{Height: -px;width: -px;position:Absolute;float: Left;Border-radius: -%;}
. First{Background-color:#ff0;Animation: Fir1s Linear 0.1s Infinite;Top:0; Left:0;}
. Second{Background-color:#0f0;Animation: sec1s Linear 0.2s Infinite;Top:0; Left: -px;}
. Third{Background-color:#00f;Animation: Thi1s Linear 0s Infinite;Top: -px; Left:0;}
@keyframes Fir{0% {Top:0; Left:0; } 25% {Top: -px; Left:0; } 50% {Top: -px; Left: -px; } 75% {Top:0px; Left: -px; }}
@keyframes sec{0% {Top:0; Left: -px; } 25% {Top:0; Left:0; } 50% {Top: -px; Left:0; } 75% {Top: -px; Left: -px; }}
@keyframes Thi{0% {Top: -px; Left:0; } 25% {Top: -px; Left: -px; } 50% {Top:0; Left: -px; } 75% {Top:0; Left:0; }}

Pure css+html Making Web page loading animation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.