有沒有想過,在文字中的點點點加載效果是怎么實現的呢,下面幾句代碼就能完成,簡單易用好實現。
<!-- 頁面內容 index.html -->
<!DOCTYPE html>
<html>
<body>
<div class='textContent'>
我是加載文案
</div>
</body>
</html>
.textContent {
&:after {
content: '';
animation: dots 2s linear infinite;
}
}
@keyframes dots {
30% {
content: '.';
}
60% {
content: '..';
}
90% {
content: '...';
}
}
</style>
搞定,來看看效果吧。