position:fixed实现div始终位于浏览器中固定位置,代码实现:
<div style="display: block; position: fixed; left: auto; left: 8px; margin-left: 0px; top: 50%; bottom: auto; margin-top: -50px;">测试div:left</div>
<div style="display: block; position: fixed; left: auto; right: 8px; margin-left: 0px; top: 50%; bottom: auto; margin-top: -50px;">测试div:right</div>
转载于:https://blog.51cto.com/cag2050/1329057