1. 首先是css

.print {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    -webkit-animation: dy 3s steps(60, end) infinite;
    animation: dy 3s steps(50, end) infinite;
}

@-webkit-keyframes dy {
    from {
        width: 0;
    }
}

@keyframes dy {
    from {
        width: 0;
    }
}

接着是html一个P标签

<p class="print">只需要几行代码就可以实现简单的打字效果哦~怎么样,好玩吗~</p>
评论框加载一言
在网站header或者footer添加下面的代码

    $.get("https://v1.hitokoto.cn/",function(data){ 
      $("#comment").text(data.hitokoto);
    });
    $(function(){
      $("#comment").click(function() {
        $(this).select();
      })
    })
</script>```
最后修改:2020 年 04 月 05 日
如果觉得我的文章对你有用,请随意赞赏