【问题标题】:Why are the link/span tags in my <marquee> appearing on several lines in Firefox?为什么我的 <marquee> 中的链接/跨度标签出现在 Firefox 的多行中?
【发布时间】:2011-04-04 16:03:12
【问题描述】:
<marquee behavior="scroll" scrollamount="10" onmouseover="style.cursor='hand';   this.setAttribute('scrollamount', 0, 0);"                       onmouseout="this.setAttribute('scrollamount', 6, 0);" id="ticker" direction="right">
   <div style="width:719px ;height:20px; font-family:Arial;color:red"id="ticker01">
       <span>1/2/2011</span><a href="a.aspx">one</a>
       <span>2/2/2011</span><a href="b.aspx">two</a>
       <span>3/2/2011</span><a href="c.aspx">three</a>
       <span>4/2/2011</span><a href="d.aspx">four</a>           
   </div>
</marquee>

在 IE8 中:GOOOOOOOD!!!!

显示:1/2/2011 一个 2/2/2011 两个 3/2/2011 三个 4/2/2011 四个

只有一行。

但是

在 Firefox 中:问题?????????

显示:

       1/2/2011 one 
       2/2/2011 two
       3/2/2011 three
       4/2/2011 four

一起,几条线在移动

jquery,相当于有人做同样的事情,而且是从右到左依次是;;

【问题讨论】:

  • Marquee 标签已被 W3C 弃用。我建议寻找一个 jquery 替代品。
  • jquery 选框? :remysharp.com/demo/marquee.html
  • 呃,原生的so好看多了。 jQuery 让它变得厚实...
  • 具有讽刺意味的是,原生版本在很大程度上被弃用了,因为大多数最终用户发现它丑陋且令人讨厌。它被 Geocities 上的垃圾主页严重滥用。我不会错过的。
  • 您发布的内容在最新的 Firefox 中对我来说效果很好:jsfiddle.net/ambiguous/f8fCF。您的样式表中发生了什么?

标签: javascript jquery html firefox marquee


【解决方案1】:

我猜 Firefox 可能会将 &lt;marquee&gt; 标记中的换行符呈现为就像它们是 &lt;br&gt; 标记一样?

有点烦人,但你能试着去掉换行符吗?

<marquee behavior="scroll" scrollamount="10" onmouseover="style.cursor='hand';   this.setAttribute('scrollamount', 0, 0);"                       onmouseout="this.setAttribute('scrollamount', 6, 0);" id="ticker" direction="right">
   <div style="width:719px ;height:20px; font-family:Arial;color:red"id="ticker01">
       <span>1/2/2011</span><a href="a.aspx">one</a> <span>2/2/2011</span><a href="b.aspx">two</a> <span>3/2/2011</span><a href="c.aspx">three</a> <span>4/2/2011</span><a href="d.aspx">four</a>           
   </div>
</marquee>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多