温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

怎么使用HTML5和CSS3实现生日快乐动画网页

发布时间:2022-12-02 17:43:56 阅读:216 作者:iii 栏目:编程语言
前端开发者测试专用服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

这篇文章主要介绍“怎么使用HTML5和CSS3实现生日快乐动画网页”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“怎么使用HTML5和CSS3实现生日快乐动画网页”文章能帮助大家解决问题。

HTML结构代码

<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Happy Birthday</title>
    <link rel="stylesheet" type="text/css" href="css/index.css" />
  </head>
  <body>
    <div class="htmleaf-container">
      <div class="wrapper">
        <div class="container">
          <h2>ᴴᴬᴾᴾᵞ ᴮᴵᴿᵀᴴᴰᴬᵞ</h2>

          <form class="form">
            <input
              id="userName"
              name="userName"
              type="text"
              placeholder="姓名"
            />
            <input id="pwd" name="pwd" type="password" placeholder="密码" />
            <button type="submit" id="login-button">进入</button>
          </form>
        </div>
        <ul class="bg-bubbles">
          <li>
            <img src="./img/timg.gif" style="width: 100%; height:" />
          </li>
          <li>
            <img src="./img/timg.gif" style="width: 100%; height:" />
          </li>
          <li>
            <img src="./img/timg.gif" style="width: 100%; height:" />
          </li>
          <li>
            <img src="./img/timg.gif" style="width: 100%; height:" />
          </li>
          <li>
            <img src="./img/timg.gif" style="width: 100%; height:" />
          </li>
          <li>
            <img src="./img/timg.gif" style="width: 100%; height:" />
          </li>
          <li>
            <img src="./img/timg.gif" style="width: 100%; height:" />
          </li>
          <li>
            <img src="./img/timg.gif" style="width: 100%; height:" />
          </li>
          <li>
            <img src="./img/timg.gif" style="width: 100%; height:" />
          </li>
          <li>
            <img src="./img/timg.gif" style="width: 100%; height:" />
          </li>
        </ul>
      </div>
    </div>
  <audio src="music/3.mp3" autoplay="autoplay" loop="loop">
    <script src="js/jquery-2.1.1.min.js" type="text/javascript"></script>
    <script src="js/index.js" type="text/javascript"></script>
  </body>
</html>

CSS样式代码

* {
  box-sizing: border-box;
  margin0;
  padding0;
  font-weight300;
}
body {
  font-family:"Microsoft YaHei";
  color: white;
  font-weight300;
}
body ::-webkit-input-placeholder {
  /* WebKit browsers */
  font-family:"Microsoft YaHei";
  color: white;
  font-weight300;
}
body :-moz-placeholder {
  /* Mozilla Firefox 4 to 18 */
  font-family:"Microsoft YaHei";
  color: white;
  opacity1;
  font-weight300;
}
body ::-moz-placeholder {
  /* Mozilla Firefox 19+ */
  font-family:"Microsoft YaHei";
  color: white;
  opacity1;
  font-weight300;
}
body :-ms-input-placeholder {
  /* Internet Explorer 10+ */
  font-family:"Microsoft YaHei";
  color: white;
  font-weight300;
}
.wrapper {
  background#ee9ca7;
  background-webkit-linear-gradient(top left, #ee9ca7 0%#ee9ca7 100%);
  backgroundlinear-gradient(to bottom right, #ee9ca7 0%#ee9ca7 100%);
  background-color:rgba(255,255,255,0.9);
  position: absolute;
  top:0;
  left0;
  overflow: hidden;
  background-imageurl(../img/bg.jpg);
  height100%;
  width100%;
  background-size100%;
}

.wrapper.form-success .container h2 {
  -webkit-transformtranslateY(85px);
      -ms-transformtranslateY(85px);
          transformtranslateY(85px);
}
.container {
  max-width600px;
  margin0 auto;
  margin-top7%;
  padding80px 0;
  height400px;
  text-align: center;
}
.container h2 {
  font-size40px;
  -webkit-transition-duration1s;
          transition-duration1s;
  -webkit-transition-timing-function: ease-in-put;
          transition-timing-function: ease-in-put;
  font-weight200;
}
form {
  padding20px 0;
  position: relative;
  z-index2;
}
form input {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  outline0;
  border1px solid rgba(2552552550.4);
  background-colorrgba(2552552550.2);
  width250px;
  border-radius3px;
  padding10px 15px;
  margin0 auto 10px auto;
  display: block;
  text-align: center;
  font-family"Microsoft YaHei";
  font-size18px;
  color: white;
  -webkit-transition-duration0.25s;
          transition-duration0.25s;
  font-weight300;
}
form input:hover {
  background-colorrgba(2552552550.4);
}
form input:focus {
  background-color: white;
  width300px;
  color#ee9ca7;
}
form button {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  outline0;
  background-color: white;
  font-family"Microsoft YaHei";
  border0;
  padding10px 15px;
  color#ee9ca7;
  border-radius3px;
  width250px;
  cursor: pointer;
  font-size18px;
  -webkit-transition-duration0.25s;
          transition-duration0.25s;
}
form button:hover {
  background-color#f5f7f9;
}
.bg-bubbles {
  position: absolute;
  top0;
  left0;
  width100%;
  height100%;
  z-index1;
}
.bg-bubbles li {
  position: absolute;
  list-style: none;
  display: block;
  width40px;
  height40px;
  background-colorrgba(2552552550.15);
  bottom: -160px;
  -webkit-animation: square 30s infinite;
  animation: square 30s infinite;
  -webkit-transition-timing-function: linear;
  transition-timing-function: linear;
}
.bg-bubbles li:nth-child(1) {
  left10%;
}
.bg-bubbles li:nth-child(2) {
  left20%;
  width80px;
  height80px;
  -webkit-animation-delay2s;
          animation-delay2s;
  -webkit-animation-duration17s;
          animation-duration17s;
}
.bg-bubbles li:nth-child(3) {
  left25%;
  -webkit-animation-delay4s;
          animation-delay4s;
}
.bg-bubbles li:nth-child(4) {
  left40%;
  width60px;
  height60px;
  -webkit-animation-duration22s;
          animation-duration22s;
  background-colorrgba(2552552550.25);
}
.bg-bubbles li:nth-child(5) {
  left70%;
}
.bg-bubbles li:nth-child(6) {
  left80%;
  width120px;
  height120px;
  -webkit-animation-delay3s;
          animation-delay3s;
  background-colorrgba(2552552550.2);
}
.bg-bubbles li:nth-child(7) {
  left32%;
  width160px;
  height160px;
  -webkit-animation-delay7s;
          animation-delay7s;
}
.bg-bubbles li:nth-child(8) {
  left55%;
  width20px;
  height20px;
  -webkit-animation-delay15s;
          animation-delay15s;
  -webkit-animation-duration40s;
          animation-duration40s;
}
.bg-bubbles li:nth-child(9) {
  left25%;
  width10px;
  height10px;
  -webkit-animation-delay2s;
          animation-delay2s;
  -webkit-animation-duration40s;
          animation-duration40s;
  background-colorrgba(2552552550.3);
}
.bg-bubbles li:nth-child(10) {
  left90%;
  width160px;
  height160px;
  -webkit-animation-delay11s;
          animation-delay11s;
}
@-webkit-keyframes {
  0% {
    -webkit-transformtranslateY(0);
            transformtranslateY(0);
  }
  100% {
    -webkit-transformtranslateY(-900pxrotate(600deg);
            transformtranslateY(-900pxrotate(600deg);
  }
}
@keyframes {
  0% {
    -webkit-transformtranslateY(0);
            transformtranslateY(0);
  }
  100% {
    -webkit-transformtranslateY(-900pxrotate(600deg);
            transformtranslateY(-900pxrotate(600deg);
  }
}

关于“怎么使用HTML5和CSS3实现生日快乐动画网页”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识,可以关注亿速云行业资讯频道,小编每天都会为大家更新不同的知识点。

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

原文链接:https://blog.51cto.com/ruan365392777/5729823

AI

开发者交流群×