AS3 bug? Newline automatically entered after css tag
I am rendering a TextField (Flash CS5) with the following css and html properties :
css = "a {font-weight: bold;} fu {colo开发者_运维百科r: #00A0A0;}"
wordWrap = true
multiline = true
html = <![CDATA["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>"]]>
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
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 = ""[...]the past centuries…
<span class=\"foo\">WE AIM TO CARRY ON WITH THE INNOVATION</span>"";
Instead of going the complex "span" way, just add this in you css description:
css = "a {font-weight: bold;} fu {color: #00A0A0; display:inline;}"
精彩评论