html CSS - 屁视差效应

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html CSS - 屁视差效应相关的知识,希望对你有一定的参考价值。

.parallax {  
background-image: url("http://example.com/wp-content/uploads/2017/08/my-background-image.jpg");
height: 100%; 
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
margin-left:-410px;
margin-right:-410px;
}
 
.parallax-content { 
width:50%;
margin:0 auto;
color:#FFF;
padding-top:50px; 
} 
<div class="parallax">
<div class="parallax-content">
 
Your content goes here...
 
</div>
</div>

以上是关于html CSS - 屁视差效应的主要内容,如果未能解决你的问题,请参考以下文章

使用CSS和JavaScript创建基本的视差滚动效果

javascript 背景视差效应

Android中的视差效应

html 纯CSS视差滚动

Amazing!巧用 CSS 视差实现酷炫交互动效

CSS视差标题和粘性导航互斥?