Skip to content

Instantly share code, notes, and snippets.

@xieranmaya
Created June 4, 2015 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xieranmaya/5467fcc6dbd7243ac6be to your computer and use it in GitHub Desktop.
Save xieranmaya/5467fcc6dbd7243ac6be to your computer and use it in GitHub Desktop.
纯CSS给一行文字后面加上简单的loading效果
.loading-anim {
font-size: 64px;
display: inline-block;
}
.loading-anim:after {
content: "\2026";
font-family: serif;
overflow: hidden;
display: inline-block;
vertical-align: bottom;
animation: loading 1.2s infinite;
}
@keyframes loading-anim {
0%, 25% {
width: 0;
}
26%, 50% {
width: 0.333em;
}
51%, 75% {
width: 0.666em;
}
76%, 100% {
width: 1em;
}
}
@yongdi
Copy link

yongdi commented Mar 16, 2017

@Keyframes loading-anim

这里写错了, 应该是loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment