答案 0 :(得分:1)
如果要将元素修复到页面的侧面,请在CSS中使用position: absolute
或position: fixed
。滚动时fixed
将保留在同一位置; absolute
将滚动内容):
.sidebar {
/* fix the element relative to the window */
position: absolute;
/* fix the left side of the element to the left side of the window
(distance of 0 between left of element and left of window) */
left: 0;
/* same for top and bottom */
top: 0;
bottom: 0;
/* fix it to a certain width */
width: 75px;
}
其余的互动可以通过JavaScript完成。