























利用背景图的background-position 实现
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
.box{
position:relative;
width:200px;
height:200px;
border:1px solid red;
background:url(../images/heightbig.jpg) no-repeat scroll 0 -232px ;
background-size:100%;
}
</style>
</head>
<body>
<div class="box"></div>
</body>
</html>
原图

效果:

.box{ position:relative; width:200px; height:200px; border:1px solid red; background:url(../images/heightbig.jpg) no-repeat; background-size:100%; background-position: bottom; }
background-attachment设置背景图像是否固定或者随着页面的其余部分滚动。
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。