基本上,我希望图像从窗口右侧一直落到屏幕上,我尝试了这样的操作(请参阅下面的代码片段)
#falling2 {
position: absolute;
top: 0;
right: 0;
z-index: -2;
}
<marquee id="falling2" height="100%" direction=down scrollamount="20">
<img src="http://via.placeholder.com/50x50">
</marquee>
但是,由于某种原因,它仍然粘在左侧。
我尝试了这里的堆栈溢出解决方案,但它们似乎没有解决我的问题。
最佳答案
#falling2 {
position: absolute;
left: 0;
z-index: -2;
text-align: right;
}
<marquee id="falling2" height="100%" direction=down scrollamount="20">
<img src="http://via.placeholder.com/50x50">
</marquee>
关于html - 无法使用 HTML 正确定位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49398291/