1.让图片处理居中的位置,当分辨率变化后就会自动裁减两边的。

最好用 背景图片,eg:

<div class="boundary">

<div class="by_main">

</div>

</div>
.boundary {
width: 100%;
overflow: hidden;
margin: 0 auto;
}
.by_main{
background: url("../images/top.jpg") center center no-repeat;
height: 768px;
}


2.当背景是一整张图片,内容太多,出现滚动条又想让图片自动拉伸,自适应
<div class="frame"> </div>

.frame{
    background: url("../images/bg.jpg") center no-repeat;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-attachment:fixed;
    min-height: 100%;
}

 
                    
            
                

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2021-07-31
  • 2021-06-07
猜你喜欢
  • 2022-01-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
  • 2021-08-30
相关资源
相似解决方案