2023年新年倒计时HTML源代码,2023年春节倒计时代码,包含NewYear.css、NewYear.js、newyear.png及index.html。直接运行index.html即可。
在这里插入图片描述

完整版源代码下载地址:2023年新年倒计时HTML源代码,2023年春节倒计时代码

NewYear.css

/*初始化*/
* {
  padding: 0;
  margin: 0 auto;
}
/*背景色*/
body,
html {
  background: url(./img/newyear.png) no-repeat;
  background-size: 100% 100%;
  background-attachment: fixed;
  /* background-color: black; */
}
/*父盒子*/
.fa {
  color:#6c5ce7;
  margin-top: 200px;
  background-color: rgba(0, 17, 17, 0.5);
  /*边框圆角*/
  border-radius: 80px;
  /*伸缩布局*/
  display: flex;
  /*改变主轴方向  竖排*/
  flex-direction: column;
}
.fir {
  margin-left: 620px;
  margin-bottom: 100px;
  font-size: 80px;
}
.fa .sj {
  /*伸缩布局*/
  display: flex;
  /*改变主轴方向*/
  flex-direction: column;
}
.fa .sj div {
  width: 100%;
  /*伸缩布局*/
  display: flex;
  /*主轴排列方式*/
  justify-content: center;
  color: black;
  margin-bottom: 60px;
  /*多行侧轴排列方式*/
  align-content: space-around;
  color:#ff7675;
  font-size: 55px;
}
.fa .sj .zi {
  color:#d63031;
}

index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>新年倒计时</title>
    <link rel="stylesheet" href="NewYear.css">
    <script src="NewYear.js"></script>
</head>
<body>
    <div class="fa">
        <span class="fir">距离2023春节(1-22)还有</span>
        <div class="sj">
            <div><span></span><span class="zi">天</span></div>
            <div><span></span><span class="zi">时</span></div>
            <div><span></span><span class="zi">分</span></div>
            <div><span></span><span class="zi">秒</span></div>
        </div>
    </div>
</body>
</html>

完整版源代码下载地址:2023年新年倒计时HTML源代码,2023年春节倒计时代码

Logo

华为云1024程序员节送福利,参与活动赢单人4000元礼包,更有热门技术干货免费学习

更多推荐