一、使用position的sticky属性实现。bash
position
sticky
position: sticky; top: 0; 复制代码
转载于:https://juejin.im/post/5cc905f6f265da036902a596post