更多>
最新下载
24小时阅读排行榜
- 1 ChatExcel进行文本转数字_ChatExcel文本数值转换与格式化
- 2 在css中animation-delay延迟使用
- 3 css制作模态弹窗样式技巧
- 4 如何在Golang中使用VS Code远程开发
- 5 瑞达写作官网登录端点 瑞达写作App官方最新下载点
- 6 JavaScript函数式编程范式与实用技巧
- 7 win11怎么解决应用商店错误代码0x80072f30_Win11应用商店0x80072f30错误修复方法
- 8 win11玩英雄联盟fps低怎么办 win11玩LOL低帧率优化方法
- 9 华为MateView 32对决戴尔U3223QE:专业级显示器的色彩与护眼之战,为谁的眼睛买单更值?
- 10 c++中智能指针shared_ptr和unique_ptr的使用场景 _c++智能指针应用场景与管理技巧
- 11 在css中如何避免margin塌陷问题
- 12 composer如何处理 require-dev 依赖在生产环境安装的问题
- 13 京东双十一满减活动怎么参与 京东跨店满减计算方式讲解
- 14 XML特殊字符如何处理
- 15 c++怎么安全地关闭一个正在运行的线程_c++线程终止与资源安全回收方法
更多>
最新教程
-
- Node.js 教程
- 6009 2025-08-28
-
- CSS3 教程
- 887689 2025-08-27
-
- Rust 教程
- 9675 2025-08-27
-
- Vue 教程
- 11786 2025-08-22
-
- PostgreSQL 教程
- 9116 2025-08-21
-
- Git 教程
- 4759 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


