How to create CSS3 loading effects
How to create the loading effect of CSS3? Why do we need loading effects? How to set loading effects? Today we will introduce it to you in detail.
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>CSS3 loading特效</title>
<meta name="keywords" content=" CSS3 loading特效" />
<link rel="stylesheet" href="css/normalize.css">
<style>
* {
box-sizing: border-box;
overflow: hidden;
}
body {
padding-top: 10em;
text-align: center;
}
.loader {
position: relative;
margin: auto;
width: 350px;
color: white;
font-family: "Roboto Condensed", sans-serif;
font-size: 250%;
background: linear-gradient(180deg, #222 0, #444 100%);
box-shadow: inset 0 5px 20px black;
text-shadow: 5px 5px 5px rgba(0,0,0,0.3);
}
.loader:after {
content: "";
display: table;
clear: both;
}
span {
float: left;
height: 100px;
line-height: 120px;
width: 50px;
}
.loader > span {
border-left: 1px solid #444;
border-right: 1px solid #222;
}
.covers {
position: absolute;
height: 100%;
width: 100%;
}
.covers span {
background: linear-gradient(180deg, white 0, #ddd 100%);
animation: up 2s infinite;
}
@keyframes up {
0% { margin-bottom: 0; }
16% { margin-bottom: 100%; height: 20px; }
50% { margin-bottom: 0; }
100% { margin-bottom: 0; }
}
.covers span:nth-child(2) { animation-delay: .142857s; }
.covers span:nth-child(3) { animation-delay: .285714s; }
.covers span:nth-child(4) { animation-delay: .428571s; }
.covers span:nth-child(5) { animation-delay: .571428s; }
.covers span:nth-child(6) { animation-delay: .714285s; }
.covers span:nth-child(7) { animation-delay: .857142s; }
</style>
<script src="js/prefixfree.min.js"></script>
</head>
<body>
<div>
<span>L</span>
<span>O</span>
<span>A</span>
<span>D</span>
<span>I</span>
<span>N</span>
<span>G</span>
<div>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
</div>
<div style="width: 100%; height: 50px; line-height: 50px; text-align: center;">
</div>
</body>
</html>There are so many codes for using CSS3 to do loading effects. For more exciting content, please pay attention to other related articles on the php Chinese website!
Related reading:
How to use CSS3 to create icon effects
##How to use CSS3 to create switching special effects for irregular images
How to use CSS3 to create text animation under lighting
The above is the detailed content of How to create CSS3 loading effects. For more information, please follow other related articles on the PHP Chinese website!
Hot AI Tools
Undresser.AI Undress
AI-powered app for creating realistic nude photos
AI Clothes Remover
Online AI tool for removing clothes from photos.
Undress AI Tool
Undress images for free
Clothoff.io
AI clothes remover
AI Hentai Generator
Generate AI Hentai for free.
Hot Article
Hot Tools
Notepad++7.3.1
Easy-to-use and free code editor
SublimeText3 Chinese version
Chinese version, very easy to use
Zend Studio 13.0.1
Powerful PHP integrated development environment
Dreamweaver CS6
Visual web development tools
SublimeText3 Mac version
God-level code editing software (SublimeText3)
Hot Topics
1384
52
How to achieve wave effect with pure CSS3? (code example)
Jun 28, 2022 pm 01:39 PM
How to achieve wave effect with pure CSS3? This article will introduce to you how to use SVG and CSS animation to create wave effects. I hope it will be helpful to you!
Use CSS skillfully to realize various strange-shaped buttons (with code)
Jul 19, 2022 am 11:28 AM
This article will show you how to use CSS to easily realize various weird-shaped buttons that appear frequently. I hope it will be helpful to you!
How to hide elements in css without taking up space
Jun 01, 2022 pm 07:15 PM
Two methods: 1. Using the display attribute, just add the "display:none;" style to the element. 2. Use the position and top attributes to set the absolute positioning of the element to hide the element. Just add the "position:absolute;top:-9999px;" style to the element.
How to implement lace borders in css3
Sep 16, 2022 pm 07:11 PM
In CSS, you can use the border-image attribute to achieve a lace border. The border-image attribute can use images to create borders, that is, add a background image to the border. You only need to specify the background image as a lace style; the syntax "border-image: url (image path) offsets the image border width inward. Whether outset is repeated;".
It turns out that text carousel and image carousel can also be realized using pure CSS!
Jun 10, 2022 pm 01:00 PM
How to create text carousel and image carousel? The first thing everyone thinks of is whether to use js. In fact, text carousel and image carousel can also be realized using pure CSS. Let’s take a look at the implementation method. I hope it will be helpful to everyone!
How to enlarge the image by clicking the mouse in css3
Apr 25, 2022 pm 04:52 PM
Implementation method: 1. Use the ":active" selector to select the state of the mouse click on the picture; 2. Use the transform attribute and scale() function to achieve the picture magnification effect, the syntax "img:active {transform: scale(x-axis magnification, y Axis magnification);}".
How to set animation rotation speed in css3
Apr 28, 2022 pm 04:32 PM
In CSS3, you can use the "animation-timing-function" attribute to set the animation rotation speed. This attribute is used to specify how the animation will complete a cycle and set the speed curve of the animation. The syntax is "element {animation-timing-function: speed attribute value;}".
How to implement global loading effect in Vue
Jun 11, 2023 am 09:05 AM
In front-end development, we often have a scenario where the user needs to wait for the data to be loaded during interaction with the web page. At this time, there is usually a loading effect displayed to remind the user to wait. In the Vue framework, it is not difficult to implement a global loading effect. Let’s introduce how to implement it. Step 1: Create a Vue plug-in We can create a Vue plug-in named loading, which can be referenced in all Vue instances. In the plug-in, we need to implement the following two methods: s


