js+css实现数字led时钟代码

代码语言:html

所属分类:其他

代码描述:js+css实现数字led时钟代码

代码标签: js css 数字 led 时钟 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">

  
  
  
<style>
body{
    padding: 100px;
}
#clock {
  display: flex;
  align-items: center;
  font-weight: 700;
  color: red;
  font-size: 60px;
}
#clock .digit {
  width: 70px;
  height: 130px;
  position: relative;
  margin-right: 10px;
  margin-left: 10px;
}
#clock .digit .segment {
  background-color: red;
  opacity: 0.1;
  position: absolute;
}
#clock .digit .active {
  opacity: 1;
}
#clock .digit .s1, #clock .digit .s4, #clock .digit .s7 {
  height: 10px;
  width: 50px;
}
#clock .digit .s2, #clock .digit .s3, #clock .digit .s5, #clock .digit .s6 {
  height: 50px;
  width: 10px;
}
#clock .digit .s1 {
  top: 0px;
  left: 10px;
}
#clock .digit .s2 {
  top: 10px;
  left: 0px;
}
#clock .digit .s3 {
  top: 10px;
  right: 0px;
}
#clock .digit .s4 {
  top: 60px;
  left: 10px;
}
#clock .digit .s5 {
  top: 70px;
  left: 0px;
}
#clock .digit .s6 {
  top: 70px;
  right: 0px;
}
#clock .digit .s7 {
  bottom: 0px;
  left: 10px;
}
</style>




</head>

<body >
  <div id='clock'>
  <div class='digit'>
    <div class='segment s1'></div>
    <div class='segment s2'></div>
    <div class='segment s3'></div>
    <div class='segment s4'></div>
    <div class='segment s5'></div>
    <div class='segment s6'></div>
    <div class='segment s7'></div>
  </div>
  <div class='digit'>
    <div class='segment s1'></div>
    <div class='segment s2'></div>
    <div class='segment s3'></div>
    <div class='segment s4'></div>
    <div class='segment s5'></div>
    <div class='segment s6'></div>
    <div class='segment s7'></div>
  </div>
  :
  <div class='digit'>
    <div class='segment s1'></div>
    <div class='segment s2'></div>
    <div class='segment s3'></div>
    <div class='segment s4'></div>
    <div class='segment s5'></div>
    <div class='segment s6'></div>
    <.........完整代码请登录后点击上方下载按钮下载查看

网友评论0