一、📚网站介绍
基于html+css+js制作的表白网页代码,可以直接替换文字和图片即可使用
二、🔗作品效果
▶️视频演示
https://live.csdn.net/v/embed/237887
(title-103 满天星星音乐背景动画特效)]
🧩 截图演示
三、💒 作品代码
🧱HTML代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<title>唯美满天星</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<audio controls autoplay>
<source src="mp3/Approaching%20Nirvana%20-%20You.mp3">
</audio>
<div id="background" class="wall"></div>
<div id="midground" class="wall"></div>
<div id="foreground" class="wall"></div>
<div id="top" class="wall"></div>
</body>
</html>
🏠CSS代码
html,body{
margin: 0;
padding: 0;
}
/*满天星*/
audio{
z-index: 5;
position: absolute;
bottom: 0;
opacity: 0.1;
-webkit-transition: all 2s;
-moz-transition: all 2s;
-ms-transition: all 2s;
-o-transition: all 2s;
transition: all 2s;
}
audio:hover{
opacity: 1;
}
.wall{
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
div#background{
background: url("../img/preview.jpg")no-repeat;
-webkit-animation: dd 100s linear infinite;
-moz-animation: dd 100s linear infinite;
-o-animation: dd 100s linear infinite;
animation: dd 100s linear infinite;
background-size: cover;
}
div#midground{
background: url("../img/midground.png");
z-index: 1;
-webkit-animation: cc 100s linear infinite;
-moz-animation: cc 100s linear infinite;
-o-animation: cc 100s linear infinite;
animation: cc 100s linear infinite;
}
div#foreground{
background: url("../img/foreground.png");
z-index: 2;
-webkit-animation: cc 153s linear infinite;
-o-animation: cc 153s linear infinite;
-moz-animation: cc 153s linear infinite;
animation: cc 153s linear infinite;
}
div#top{
background: url("../img/midground.png");
z-index: 4;
-webkit-animation: dd 100s linear infinite;
-o-animation: dd 100s linear infinite;
animation: da 100s linear infinite;
}
@-webkit-keyframes cc {
from{
background-position: 0 0;
transform: translateY(10px);
}
to{
background-position: 600% 0;
}
}
@-o-keyframes cc {
from{
background-position: 0 0;
transform: translateY(10px);
}
to{
background-position: 600% 0;
}
}
@-moz-keyframes cc {
from{
background-position: 0 0;
transform: translateY(10px);
}
to{
background-position: 600% 0;
}
}
@keyframes cc {
0%{
background-position: 0 0;
}
100%{
background-position: 600% 0;
}
}
@keyframes da {
0%{
background-position: 0 0;
}
100%{
background-position: 0 600%;
}
}
@-webkit-keyframes da {
0%{
background-position: 0 0;
}
100%{
background-position: 0 600%;
}
}
@-moz-keyframes da {
0%{
background-position: 0 0;
}
100%{
background-position: 0 600%;
}
}
@-ms-keyframes da {
0%{
background-position: 0 0;
}
100%{
background-position: 0 600%;
}
}
四、🎁更多源码
【干货分享】自学编程的小伙伴可以前往我的 gitee 仓库(持续更新中...)
📕【web学习指南】从web基础、计算机基础到前端常用框架的教程,涵盖前端大部分必备知识(学习指南 + 技术文章 + 资源分享)