我在页面底部有一段文字,上面写着“Built By Me”。我将其固定在距离窗口底部和左侧35像素的位置,所以当您滚动时它会移动。实际上,我想要的是垂直固定它,这样当您上下滚动时它就会移动,并且始终距离窗口底部35像素,但是将其放置在页面左侧(而不是屏幕)距离为35像素,这样当您水平滚动时它就不会移动。我查看了Position element fixed vertically, absolute horizontally,但不幸的是它对我没有用。FYI,我目前正在使用以下代码将其固定在顶部和底部,这很好用(但在水平滚动时也会移动):
非常感谢您能提供任何指导,因为我无法想出如何仅在一个轴上修复它?
戴夫
#sticky {
position: fixed;
bottom: 35px;
left: 35px;
width: 206px;
padding: 0;
font-size: 0.6875em;
}
*html #sticky {
position: absolute;
bottom: 0px;
}
<div id="sticky">
Built by Me
</div>
非常感谢您能提供任何指导,因为我无法想出如何仅在一个轴上修复它?
戴夫