使对象粘稠似乎不起作用

问题描述 投票:0回答:1

我一直在尝试在右侧贴上图像,而人们可以在左侧滚动显示艺术家姓名,但可能由于左侧已经滚动而无法正常工作。这是我正在尝试的页面:

https://aarongalleries.com/test-page/

而且我的位置:在我的CSS中粘为:

div#hot-random_image-2 {
position: -webkit-sticky !important;
position: sticky !important;
top: 50px !important;
}

Thx。

css sticky
1个回答
0
投票

请尝试以下代码

#random-image-2 {
    width: 365px;                    /* Set proper width */
    height: auto;
    position: fixed;                 /* Add instated of sticky */
    /* top: 50px !important;  */     /* Remove this line */
}
© www.soinside.com 2019 - 2024. All rights reserved.