background-attachmen视差滚动效果 - 电脑知识 - 【三明电脑网】_三明电脑维修_三明笔记本电脑维修_监控安装_市区上门维修

全国统一24小时服务热线:400-0000-000400-0000-000  / 1399000000

当前位置:首页 > 电脑知识 > 正文

background-attachmen视差滚动效果

发布日期:2018-04-25

摘要:文章目录索引(?) [-] 文章简介 代码演示文章简介一般有些时间,背景放了一个大图,上面再放个透明的图(如地图等),然后随着滚轮滚动,形成一种视差,主要是用到background-att...

文章目录索引(?) [-]

    文章简介 代码演示

文章简介

一般有些时间,背景放了一个大图,上面再放个透明的图(如地图等),然后随着滚轮滚动,形成一种视差,主要是用到background-attachment: fixed;属性。

代码演示
  1. <style>.fl{float:left!important;_display:inline;}
  2. .main2{background-image:url(main1_lc.jpg);background-repeat:no-repeat;background-position:center;background-attachment:fixed;}.wrap{width:1000px;height:1830px;margin:0pxauto;overflow:hidden;line-height:24px;}
  3. .main2_of1{margin:200px000;}.main2_of2{margin:55px0020px;width:450px;border-left:#fff1pxsolid;color:#fff;position:relative;height:605px;}
  4. .main2_of2dl{position:absolute;left:-9px;top:-25px;}.main2_of2dt{background:url(main1_r.png)no-repeat;font:40018px/18px"宋体";color:#040404;font-size:18px;padding:010px025px;width:75px;text-align:center;}
  5. .main2_of2dd{width:345px;line-height:20px;}.main2_of2dd{float:left;margin:20px000;}
  6. </style><divclass="main2">
  7. <divclass="wrap"><h3><imgsrc="main2.png"></h3>
  8. <divclass="flmain2_of1"><imgsrc="main2_l.png"></div><divclass="flmain2_of2">
  9. <dl><dt>2004</dt>
  10. <dd>www.pc811.comwww.pc811.comwww.pc811.comwww.pc811.comwww.pc811.com</dd><dt>2005</dt>
  11. <dd>www.pc811.comwww.pc811.comwww.pc811.comwww.pc811.comwww.pc811.com。</dd><dt>2006</dt>
  12. <dd>www.pc811.comwww.pc811.comwww.pc811.comwww.pc811.com</dd><dt>2007</dt>
  13. <dd>www.pc811.com</dd><dt>2008</dt>
  14. <dd>www.pc811.com</dd><dt>2009</dt>
  15. <dd>www.pc811.com</dd><dt>2010</dt>
  16. <dd>www.pc811.com</dd><dt>2011</dt>
  17. <dd>www.pc811.com</dd><dt>2012</dt>
  18. <dd>www.pc811.com</dd><dt>2013</dt>
  19. <dd>www.pc811.com</dd><dt>2014</dt>
  20. <dd>www.pc811.com</dd></dl>
  21. </div></div>
  22. </div>

演示地址