简体   繁体   English

"滚动时粘性侧边栏不起作用"

[英]sticky sidebar not working during scrolling

I want to have a sticky sidebar during scrolling and I have tried many methods but it is not working.我想在滚动期间有一个粘性侧边栏,我尝试了很多方法,但它不起作用。 here is my code这是我的代码

 <div class="row">

        <div class="col me-0 me-md-3 mb-3 mb-md-0 px-0 ">

            <div class="position-relative" style="top: 0;
                left: 0;
                width: 100%;


                <div class="bg-white b-r-s-cont shadow pb-4 position-sticky top-0">
               height: 100%;">
         </div>
         </div>
      </div>
        <div class="col-12 col-md-9">
       </div>
</div>

You might want to try adding position: fixed;<\/code>您可能想尝试添加position: fixed;<\/code> to the element that is supposed to be sticky.到应该是粘性的元素。

You can simply add it it the current style="..."<\/code> tag!您可以简单地将其添加到当前style="..."<\/code>标签!

"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM