h5c3 视觉差

视差滚动(Parallax Scrolling)是指让多层背景以不同的速度移动,形成立体的运动效果,带来非常出色的视觉体验。作为今年网页设计的热点趋势,越来越多的网站应用了这项技术。

原理

通过前景与背景在场景移动时产生不同的视差,从而达到简单的立体效果

页面上很多的元素在相互独立地滚动着,如果我们来对其它分层的话,可以有两到三层 :背景层,内容层,贴图层

例:QQtim

html:




    
    Title
    
    





沟通,是跨越
万水千山的亲切声音

无论何时何地,你都能自由享受QQ在各类终端
上带来的高清通话,与 好友想聊多久就聊多久

沟通,是随时随地
爽快收发

无论何时何地,你都能自由享受QQ在各类终端
上带来的高清通话,与 好友想聊多久就聊多久

沟通,是志同道合
的他们放肆青春

无论何时何地,你都能自由享受QQ在各类终端
上带来的高清通话,与 好友想聊多久就聊多久

css:

/*重置样式 reset.css==================*/
*{
    padding: 0;
    margin: 0;
}
body{
    font-size: 14px;
    font-family: 'Microsoft Yahei';
    color: #333;
}
ul {
    list-style:none;
}
a{
    color:#333;
    text-decoration: none;
}
/*模块样式 module.css=================*/
.bg {
    background-attachment: fixed;
}
.qq_nav{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: url("images/nav_bg.png");

}
.qq_nav .wrapper{
    width: 90%;
    height: 75px;
    margin: 0 auto;
}
.qq_nav .wrapper .logo{
    width: 100px;
    height: 75px;
    background: url("images/nav_brand.png") no-repeat center;
    text-indent: -9999em;
    float: left;
}
.qq_nav .wrapper .nav{
    float: left;
    overflow: hidden;
}
.qq_nav .wrapper .nav li{
    float: left;
    font-size: 18px;
    height:75px;
    line-height: 75px;
    margin-left:20px;
}
.qq_nav .wrapper .nav li a{
    display: block;
    padding: 0 20px;
}
.qq_nav .wrapper .nav li a.active,
.qq_nav .wrapper .nav li a:hover{
    background-color: #12B7f5;
}
.qq_nav .wrapper .right {
    float: right;
}
.qq_nav .wrapper .right .register{
    float: left;
    height: 36px;
    width: 96px;
    background-color: #24c1fc;
    border-radius: 18px;
    text-align: center;
    line-height: 36px;
    color:#fff;
    margin-top: 20px;
}
.qq_nav .wrapper .right ul{
    float: left;
    overflow: hidden;
    margin-top: 10px;
}
.qq_nav .wrapper .right ul li{
    float: left;
    margin-left: 35px;
}
.qq_nav .wrapper .right ul li a{
    text-shadow: 0 0 3px #333;
}
.qq_nav .wrapper .right p{
    margin-left: 149px;
    margin-top: 44px;
}
/*展示部分*/
.qq_banner {
    height: 880px;
    padding-top: 150px;
    background: url("images/banner-bg.jpg") no-repeat center top;
}
.qq_banner img{
    display: block;
    margin: 20px auto;
}
.qq_banner img:last-child{
    width: 100%;
}
/*语音部分*/
.qq_sound{

}
.qq_sound h1{
    width: 100%;
    height: 330px;
    background: url("images/sound-text.png") no-repeat center/cover;
}
.qq_sound .bg{
    height: 500px;
    background: url("images/sound-bg.jpg") no-repeat center/cover;
    background-attachment: fixed;
}
.qq_sound .content{
    height: 500px;
    width: 90%;
    margin: 0 auto;
}
.qq_sound .content .phone{
    width: 700px;
    height: 700px;
    background: url("images/sound-phone.png") no-repeat center top/cover;
    position: absolute;
    margin-top: -200px;
}
.qq_sound .content h2{
    font-weight: normal;
    font-family: '幼圆';
    float: right;
    font-size: 40px;
    text-align: right;
    padding-top: 100px;
    width: 60%;
}
.qq_sound .content p{
    font-weight: normal;
    font-family: '幼圆';
    float: right;
    text-align: right;
    width: 60%;
    padding-top: 50px;
    font-size: 18px;
    text-shadow: 0 0 2px #333 ;
}
/*文件部分*/
.qq_file .bg{
    height: 500px;
    background: url("images/file-bg.jpg") no-repeat center /cover;
}
.qq_file .content{
    height: 500px;
    width: 90%;
    margin: 0 auto;
    position: relative;
}
.qq_file .content .mac {
    width: 600px;
    height: 340px;
    position: absolute;
    background: url("images/file-mac.png") no-repeat center /cover;
    right:-60px;
}
.qq_file .content h2,
.qq_file .content p{
    font-weight: normal;
    font-family: '幼圆';
    float: left;
    text-align:left;
    width: 60%;
}
.qq_file .content h2{
    padding-top: 100px;
    font-size: 40px;
}
.qq_file .content p{
    font-size: 18px;
    padding-top: 50px;
    text-shadow: 0 0 2px #333;
}
/*兴趣部分样式*/
.qq_hobby .bg {
    height: 500px;
    background: url('images/interest-bg.jpg') no-repeat center /cover;
}

.qq_hobby .content {
    height: 500px;
    width: 95%;
    margin: 0 auto;
    position: relative;
    /*border:1px solid red;*/
}

.qq_hobby .content .phone {
    width: 350px;
    height: 500px;
    background: url('images/interest-phone.png') no-repeat center top/cover;
    position: absolute;
    left: 0;
    top: 0;
}

.qq_hobby .content h2 {
    float: right;
    font-size: 40px;
    text-align: right;
    padding-top: 100px;
    width: 60%;
    font-weight: normal;
    font-family: '幼圆';
}

.qq_hobby .content p {
    float: right;
    text-align: right;
    width: 60%;
    padding-top: 50px;
    font-size: 18px;
    text-shadow: 0 0 2px #333;
    font-weight: normal;
    font-family: '幼圆';
}
/*尾部部分样式*/
.qq_footer {
    height: 250px;
    background: #2a2a2a;
    font-size: 12px;
    text-align: center;
    padding-top: 50px;
    color: #666;
}

.qq_footer .plats {
    width: 75%;
    height: 150px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
}

.qq_footer .plats a {
    display: block;
    background: url(images/footer.png) no-repeat;
    width: 80px;
    /*设置字体*/
    color: #666;
    height: 10px;
    padding-top: 60px;
}

.qq_footer .plats a:hover {
    color: rgb(18, 183, 245);
}

.qq_footer .plats .phone:hover {
    background-position: 0 -93px;
}

.qq_footer .plats .pc {
    background-position: -106px 0;
}

.qq_footer .plats .pc:hover {
    background-position: -106px -93px;
}

.qq_footer .plats .mac {
    background-position: -212px 0;
}

.qq_footer .plats .mac:hover {
    background-position: -212px -93px;
}

.qq_footer .plats .pad {
    background-position: -318px 0;
}

.qq_footer .plats .pad:hover {
    background-position: -318px -93px;
}

 

你可能感兴趣的:(h5c3 视觉差)