【问题标题】:AS3 bug? Newline automatically entered after css tagAS3 错误? css标签后自动输入换行符
【发布时间】:2011-09-23 07:28:48
【问题描述】:

我正在渲染一个具有以下 css 和 html 属性的 TextField (Flash CS5):

css = "a {font-weight: bold;} fu {color: #00A0A0;}"
wordWrap = true
multiline = true
html = <![CDATA[&quot;Phoenicians were pioneering artisans and ingenious craftsmen…

They developed the technique behind the production of transparent glass…

Their innovation spread around the globe throughout the past centuries…

<fu>WE AIM TO CARRY ON WITH THE INNOVATION</fu>&quot;]]>

最后一个报价出现在“WE AIM TO...”下方的一行中。它是这样渲染的:

...

我们的目标是继续创新

"

将引用与“WE AIM...”呈现在同一行中的唯一方法是:

a) 要么把它放在 &lt;fu&gt; 里面

b) 或者完全删除 &lt;fu&gt;

这是一个 Flash 错误吗?我在 css 或 html 上做错了吗?

非常感谢,

比尔

【问题讨论】:

    标签: html css flash actionscript-3 textfield


    【解决方案1】:

    这里的问题是htmlText 只支持limited number of tags and attributes,因此坦率地说,CSS 支持很差。所以这不是一个错误,而是一个已知的限制......

    我的建议是使用带有 class 属性span 标签,例如:

    css = ".foo {color: #00A0A0;}"
    
    html = "&quot;[...]the past centuries…
    <span class=\"foo\">WE AIM TO CARRY ON WITH THE INNOVATION</span>&quot;";
    

    【讨论】:

      【解决方案2】:

      不要采用复杂的“跨度”方式,只需将其添加到您的 css 描述中:

      css = "a {font-weight: bold;} fu {color: #00A0A0; display:inline;}"

      【讨论】:

      • 谢谢!这让我发疯了
      • 我知道那种感觉。我经常遇到它。
      猜你喜欢
      • 1970-01-01
      • 2012-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多