<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>test</title>
<style type="text/css">
*{ margin:0; padding:0;}
.ndiv{ width:200px; height:400px; border:1px solid #ccc;background: #f1f1f1;}
.fix-div{ position:fixed; top:0px;}
</style>
</head>
<body>
<section style="height: 700px;"></section>
<div id="mydiv" class="ndiv" >di222v</div>
<section style="height: 700px;"></section>
</body>
</html>
本文转自豪情博客园博客,原文链接:http://www.cnblogs.com/jikey/p/3773732.html,如需转载请自行联系原作者