PDA

View Full Version : Span Style in Flex


tbeanz
05-20-2008, 03:43 PM
Hello all, I'm having a bit of trouble with changing the colour of a text using CSS. Right now, I have this simple code that displays 4 lines of text...

<mx:Text width="347" id="htmlTest" x="10" y="299">
<mx:htmlText>
<![CDATA[
This is 14 point blue italic text.<br>
<b><font color="#000000" size="10">This text is 10 point black, italic, and bold.</font></b>
<span style="color: #ff0000; font-family:'garamond,times'">this should be red</span>
<font color = "#ff0000"> This is red.</font>
]]>


</mx:htmlText>
</mx:Text>

For some reason, the "span style" one does not get formatted at all (although the same line works perfectly in Dreamweaver). Does this have to do with CSS-Flex compatibility, or is there an error in my code?

Thanks for your help,
tbeanz

drkstr
05-20-2008, 04:43 PM
I could be wrong, but I've never seen the span tag used that way. I've always seen it used to point to a css class like in this example:

http://livedocs.adobe.com/flex/3/html/help.html?content=Working_with_Text_14.html

Hope this helps,
~Aaron

tbeanz
05-20-2008, 06:53 PM
Hmmm, thanks for the help drkstr, but I'm positive that I used the span tag correctly (I even tested it out in Dreamweaver, and it works).

I appreciate your help!

drkstr
05-20-2008, 08:01 PM
But it doesn't work in Flex right? To my knowledge, they SHOULD work the same. But it seems they don't. I guess it will take a little more investigation.

Best Regards,
~Aaron