js实现电子时钟效果

本文实例为大家分享了js实现电子时钟效果的具体代码,供大家参考,具体内容如下
【js实现电子时钟效果】代码区域
代码如下(示例):

Document#watch{margin-top: 200px; font-size:100px; text-align: center; }

js实现电子时钟效果
文章图片

之前小编收藏了一段电子时钟的实现代码,分享给大家,也谢谢原作者的分享:
body {background: black; } #txt {position: absolute; top: 50%; left: 50%; transform: translateX(-50%) translateY(-50%); /*使时钟居中显示*/color: greenyellow; font-size: 60px; font-family: sans-serif; letter-spacing: 7px; /*creating a gradient to be used as background, and then clipping mask with text that shows background only where text is present.*/background-image: linear-gradient(to bottom right, red, yellow, green); color:transparent; -webkit-background-clip: text; border: 5px solid silver; }

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。

    推荐阅读