tags:

views:

692

answers:

2

I've got this mxml:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:htmlText>
     <![CDATA[
      <a href="foo">link me</a><b>bold me</b>
     ]]>
     </mx:htmlText>
    </mx:Text>
</mx:Application>

(In reality, the html content is coming from an xml file.) I want to give the link a color. So I've got this in my css file:

a { color:#339900; }

But I get a warning: "The CSS type selector 'a' was not processed, because the type was not used in the application."

I also tried:

a:link { color:#339900; }

and the warning changes to: "CSS selector condition type is not supported: ':link'

According to the live docs, it seems like I should be able to do both things. What am I missing?


Also I'm using a font that has no bold, but I want to use the fontThickness property to create one. I've got it working when I apply it to an entire object or class, thus:

.thickenMe { fontThickness: 150; }

I want to apply it to the [b] tag, but I'm getting similar warnings as with the [a].

+2  A: 

From what you're describing, it sounds like you're trying to put styles in a stylesheet in your Flex application. That won't work. The stylesheets you're working in are used to style the application, not html content within the application.

If you want to render styled text in a htmlText block, follow the pattern described here:

Flex 3 - Applying cascading style sheets

Justin Niessner
Ah, so I have to have a separate css file for the html content. Seems like a strange choice to me, but I'll try that....
sprugman
A: 

You need to apply the css to the content of the htmlText object not the whole application. There should be a "styleSheet" property or similar on the htmlText object you can set.

Lillemanden
yeah, I accidentally left that out of my snipped code above. I've got that.
sprugman