每当我尝试在Hspace for Marquee中输入一个%时,它就好像什么都没有输入一样。它似乎只需要一个像素值,因为屏幕尺寸的变化,我不能正确使用它,所以我非常希望它在100%的屏幕上。
当前代码:
<div style="position: absolute; bottom: 150px; left: 0px">
<marquee behavior="scroll" direction="right" scrollamount="25
"><img src="http://media.giphy.com/media/jM4bWFBKpSFeo/giphy.gif" width="94" height="88" alt="Swimming fish" hspace= "99%"></marquee>
</div>
发布于 2015-02-10 21:50:05
大多数主流浏览器仍然支持hspace,但如果它在使用marquee时遇到问题,我也不会感到惊讶。请尝试使用边距:
<div style="position: absolute; left: 0px">
<marquee behavior="scroll" direction="right" scrollamount="25
"><img src="http://media.giphy.com/media/jM4bWFBKpSFeo/giphy.gif" width="94" height="88" alt="Swimming fish" style="margin: -12px 150px"></marquee>
</div>
请注意,marquee已弃用。你应该考虑通过css动画来做同样的事情。请看this example,看看你如何通过css动画来实现同样的效果。
https://stackoverflow.com/questions/28432431
复制相似问题