div固定在浏览器的最上方,不随滚动条滚动

1 #topDIV { 
2     position: fixed;
3     top: 0;
4     z-index: 10000;
5     width: 100%;
6     height: 35px;
7     border-bottom: 1px solid #eee;
8     background-color: #f5f5f5;
9 }

把div固定在浏览器的最上方,不随滚动条滚动,类似百度、淘宝的上方。

原文地址:https://www.cnblogs.com/yaoqj/p/4188633.html