content字符生成配合CSS3 animation的点点点loading

CSS代码:
dot {
    display: inline-block; 
    height: 1em; line-height: 1;
    vertical-align: -.25em;
    overflow: hidden;
}
dot::before {
    display: block;
    content: '...\A..\A.';
    white-space: pre-wrap;
    animation: dot 3s infinite step-start both;
}
@keyframes dot {
    33% { transform: translateY(-2em); }
    66% { transform: translateY(-1em); }
}
HTML代码:
<a href="javascript:" class="grebtn">订单提交中<dot>...</dot></a>

 

posted @ 2018-06-14 17:40  风吹麦浪打  阅读(249)  评论(0编辑  收藏  举报