1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 5 <title>模拟固定定位fix</title> 6 <style> 7 html{ height:100%; overflow:hidden;} 8 body{margin:0; height:100%; overflow:auto;} 9 .box{height:2000px;} 10 .div{width:100px;height:100px;background:red; position:absolute;left:100px;top:100px;} 11 </style> 12 </head> 13 <body> 14 <div class="box"> 15 <div class="div"></div> 16 </div> 17 </body> 18 </html>
相关文章: