HTML Marquee Hspace%不会

时间:2015-02-10 13:05:24

标签: html css marquee

每当我尝试将%输入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>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:2)

大多数主流浏览器仍然支持hspace,但如果在使用选框时遇到问题,我不会感到惊讶。请尝试使用保证金:

&#13;
&#13;
<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>
&#13;
&#13;
&#13;

请注意,marquee已弃用。你应该考虑通过css动画做同样的事情。请参阅this example,了解如何通过css动画实现相同的目标。