如何制作固定在侧边的内容固定的侧边栏?

时间:2020-08-09 04:03:54

标签: html css bootstrap-4

我正在尝试使侧边栏内容跟随滚动,但在页脚停下来。目前,我放置的所有内容都太远了,与页脚重叠。

<div class="row row-no-padding">

   <div class="col-lg-8">
      Content is here.
   </div>

   <div class="col-lg-4">
      Sidebar content would be here. I want all content here to follow my scrolling
      but stop if if i go too far(stop at the footer).
   </div>

</div>

请帮助我。我知道这是一个极简主义的例子,但是我已经尝试了很多组合,以至于我不知道该写什么。

我尝试了position:fixed,但是它使内容与页脚重叠。 position:sticky不能执行任何操作,或者我没有正确使用它。

0 个答案:

没有答案