Prepare project
Project development tools
Visual Studio Code 1.44.2
Version: 1.44.2
Commit: ff915844119ce9485abfe8aa9076ec76b5300ddd
Date: 2020-04-16T16:36:23.138Z
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8 : 7.8.279.23-electron .0
OS: Windows_NT x64 10.0.19044
Project structure
index.html code is as follows
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>图片上下移动</title>
<style>
img {
animation: up .5s infinite;
}
@keyframes up {
to {
margin-top: 200px;
}
}
</style>
</head>
<body>
<img src="./images/1.jpg" alt="">
</body>
</html>
Summarize
This code can realize the infinite repeated downward movement display effect of the image, and can make the image have a dynamic effect. Image display based on html+css 129.