<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="css/reset.css"/>
<style type="text/css">
div{
height: 150px;
border:1px solid gray;
background-image:url(images/king1.jpg);
margin:50px;
overflow-x:hidden;
overflow-y:scroll;
background-repeat: no-repeat;
}
.scroll{
background-attachment: scroll;
}
.fixed{
background-attachment: fixed;
}
.local{
background-attachment: local;
}
</style>
</head>
<body>
<div class="scroll">
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
background-attachment:scroll,default,默认值<br/>
</div>
<div class="fixed">
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
background-attachment:fixed,相对于窗口固定<br/>
</div>
<div class="local">
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
background-attachment:local,相对元素内容<br/>
</div>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
<p>this is a test</p>
</body>
</html>