AS3 bug? Newline automatically entered after css t

2019-07-21 13:09发布

I am rendering a TextField (Flash CS5) with the following css and html properties :

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;]]>

The last QUOTE is rendered in a line BELOW "WE AIM TO...". It's rendered like this :

...

WE AIM TO CARRY ON WITH THE INNOVATION

"

The ONLY way to render the quote in the same line with "WE AIM..." is to :

a) Either put it INSIDE <fu>

b) Or remove <fu> altogether.

Is this a Flash bug? Am I doing something wrong with css or html?

Many thanks in advance,

Bill

2条回答
你好瞎i
2楼-- · 2019-07-21 13:31

The problem here is that htmlText supports only a limited number of tags and attributes, and thus CSS support is frankly quite poor. So it is not a bug, but a known limitation...

My recommendation would be to use a span tag with a class attribute, like:

css = ".foo {color: #00A0A0;}"

html = "&quot;[...]the past centuries…
<span class=\"foo\">WE AIM TO CARRY ON WITH THE INNOVATION</span>&quot;";
查看更多
够拽才男人
3楼-- · 2019-07-21 13:51

Instead of going the complex "span" way, just add this in you css description:

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

查看更多
登录 后发表回答