html 定位fixed

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

<html>
	<head>
		<title>123</title>
		<style>
			#sub1{
				width:50px;
				height:80px;
				border:1px solid #dcdcdc;
			}
			#sub2{
				position:fixed;
				top:250px;
				right:20px;
				width:50px;
				height:80px;
				border:1px solid #dcdcdc;
				margin-top:5px;
			}
			#sub3{
				width:250px;
				height:880px;
				border:1px solid #dcdcdc;
				margin-top:5px;
			}
		</style>
	</head>
	<body>
		<div id="parent">
			 <div id="sub1">sub1</div>
			 <div id="sub2">sub2</div>
			 <div id="sub3">sub1</div>
		</div>
	</body>
</html>