更多>
最新下载
24小时阅读排行榜
- 1 微博的浏览记录会同步吗_微博浏览记录同步规则说明
- 2 如何在Windows中配置JavaFX开发环境
- 3 如何通过css工具Sass实现循环生成类
- 4 python错误类型捕获的方法
- 5 PHP一键环境为什么不能发送邮件_邮件发送功能配置
- 6 彻底格式化硬盘并进行纯净Windows安装
- 7 Linux用户权限怎么管理_Linux用户权限管理的详细操作教程
- 8 PHPWebSocket怎么通信_PHP结合GatewayWorker实现WebSocket实时通信
- 9 抖音tiktok官方网址入口官方版 抖音tiktok官网首页快速直达
- 10 小强阅读app怎么删除书架上的书_小强阅读app已存书籍如何从书架删除详细方法
- 11 Linux SSH授权密钥与权限设置
- 12 阴阳师一起捉咪藏第三天攻略-阴阳师一起捉咪藏第三天在哪找
- 13 PHP代码怎么实现验证码生成_PHP验证码图片生成与验证步骤
- 14 css初级项目导航栏下拉效果优化
- 15 OFX代购大额汇款优势在哪里_OFX代购大额汇款优势解读
更多>
最新教程
-
- Node.js 教程
- 5769 2025-08-28
-
- CSS3 教程
- 843933 2025-08-27
-
- Rust 教程
- 9158 2025-08-27
-
- Vue 教程
- 11225 2025-08-22
-
- PostgreSQL 教程
- 8818 2025-08-21
-
- Git 教程
- 4679 2025-08-21
CSS3的全屏图片视差滚动切换特效
body { text-align: center; /*background-attachment:fixed;*/ width: 100%; }
#main { width: 100%; margin: auto }
/*.header{
background:#fff;
}*/
.header { width: 100%; height: 1080px; overflow: hidden; position: relative; background: url("a1.png") center center no-repeat; background-attachment: fixed; background-size: cover; }
.header2 { background: url("a3.png") center center no-repeat; background-attachment: fixed; background-size: cover; }
.text { position: absolute; top: 30%; left: 300px; }
.text p { font-size: 30px; font-family: "微软雅黑"; color: #fff; }
.bg-attachment { background: url("a2.png") center center no-repeat; background-attachment: fixed; background-size: cover; }
.bg-attachment .shadow { width: 100%; height: 1080px; overflow: hidden; margin: auto; }
.div2 { background: url("a4.png") center center no-repeat; background-attachment: fixed; background-size: cover; }
</style>
这是一款基于CSS3实现的全屏图片视差滚动切换特效,网页滚动视差切换代码。
<style>
* { padding: 0; margin: 0 }body { text-align: center; /*background-attachment:fixed;*/ width: 100%; }
#main { width: 100%; margin: auto }
/*.header{
background:#fff;
}*/
.header { width: 100%; height: 1080px; overflow: hidden; position: relative; background: url("a1.png") center center no-repeat; background-attachment: fixed; background-size: cover; }
.header2 { background: url("a3.png") center center no-repeat; background-attachment: fixed; background-size: cover; }
.text { position: absolute; top: 30%; left: 300px; }
.text p { font-size: 30px; font-family: "微软雅黑"; color: #fff; }
.bg-attachment { background: url("a2.png") center center no-repeat; background-attachment: fixed; background-size: cover; }
.bg-attachment .shadow { width: 100%; height: 1080px; overflow: hidden; margin: auto; }
.div2 { background: url("a4.png") center center no-repeat; background-attachment: fixed; background-size: cover; }
</style>


本站所有资源都是由网友投搞发布,或转载各大下载站,请自行检测软件的完整性!本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!如有侵权请联系我们删除下架,联系方式:admin@php.cn