纯css布局实现向下滚动动画效果

代码语言:html

所属分类:布局界面

代码描述:纯css布局实现向下滚动动画效果,三种款式

代码标签: 实现 向下 滚动 动画 效果

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


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.container {
  width: 100%;
  height: 100vh;
  background-color: #c9d6df;
  display: flex;
  align-items: center;
  justify-content: center;
}

.field {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 300px;
}

.mouse {
  width: 50px;
  height: 90px;
  border: 3px solid #333;
  border-radius: 60px;
  position: relative;
}
.mouse::before {
  content: '';
  width: 12px;
  height: 12px;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  border-radius: 50%;
  opacity: 1;
  animation: wheel 2s infinite;
  -webkit-animation: wheel 2s infinite;
}

@keyframes wheel {
  to {
    opacity: 0;
    top: 60px;
  }
}
@-webkit-keyframes wheel {
  to {
    opacity: 0;
    top: 60px;
  }
}
.scroll {
  width: 60px;
  height: 60px;
  border: 2px solid #333;
  border-radius: 50%;
  position: relative;
  animation: down 1.5s infinite;
  -webkit-animation: down 1.5s infinite;
}
.scroll::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 18px;
  width: 18px;
  height: 18px;
  border-left: 2px solid #333;
  border-bottom: 2px sol.........完整代码请登录后点击上方下载按钮下载查看

网友评论0