如何在页脚上设置一个可滚动的产品购买角图像

  • 本文关键字:滚动 图像 一个 设置 html css
  • 更新时间 :
  • 英文 :


我想在页脚中添加一个粘性图像。我想只使用html和css来实现这一点。有人能帮我想办法吗?

这是图片-https://prnt.sc/whc1kq

另外,这是我的html和css代码:

html-https://prnt.sc/whca7m

css-https://prnt.sc/whc528

提前感谢

用于将屏幕底部的任何图像与粘性对齐

.fixImage{
position: fixed;
bottom: 0;
right: 0;
}
<img src="yourimagepath" class="fixImage"/>

根据请求者的查询,我已经用max-width: 250px更新了代码

.fixImage{
position: fixed;
bottom: 0;
right: 0;
max-width: 250px;
}
<img src="https://placehold.it/412x413" class="fixImage"/>

尝试使用绝对位置而不是粘性,并调整边距。我确信这会奏效。

你是这样的意思吗?

position: absolute;
position: sticky;
z-index: 1;
float: right;

最新更新