-1

尝试进行 2 列布局。示例https://medium.com/

滚动时左侧边栏不移动。此外,如果您的鼠标在侧边栏上,您将无法滚动主要内容。

我该如何实现它。我整天都在尝试w0w。

谢谢

4

1 回答 1

1

工作 FIDDLE 演示

HTML

<div class="wrapper">
    <div class="sidebar">
        SIDE
    </div>
   <div class="main">
       CONTENT
    </div>
</div>

CSS

.wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}
.main {
    background: red;
    height: 100%;
    overflow: auto;
}
.sidebar {
    background: blue;
    width: 200px;
    height: 100%;
    float: left;
    overflow: auto;
}
于 2013-05-25T11:59:37.200 回答