Adobe Flex Actionscript Question:
How do we use css styles in flex?

Answer:
External styles are defined in a separate file and can be used in any MXML file that references the CSS file. You reference a CSS file into an MXML file with the source property of the <mx:Style> tag, as follows:
<mx:Style source="../siteStyles.css"/>
Embedded styles are defined in an MXML file and can only be used in that file. Embedded styles are defined with the <mx:Style> tag, as follows:
<mx:Style>
.myclass { background-color: xFF0000 }
TextInput { font-family: Helvetica; font-size: 12pt }
</mx:Style>
<mx:Canvas>
<mx:Button styleName="myclass">
</mx:Canvas>
Inline styles are defined in an MXML tag and can only be used in that tag. Inline styles are defined as follows:
<mx:Button color="red"...>
<mx:TextInput fontFamily="Helvetica" fontSize="12"...>
<mx:Style source="../siteStyles.css"/>
Embedded styles are defined in an MXML file and can only be used in that file. Embedded styles are defined with the <mx:Style> tag, as follows:
<mx:Style>
.myclass { background-color: xFF0000 }
TextInput { font-family: Helvetica; font-size: 12pt }
</mx:Style>
<mx:Canvas>
<mx:Button styleName="myclass">
</mx:Canvas>
Inline styles are defined in an MXML tag and can only be used in that tag. Inline styles are defined as follows:
<mx:Button color="red"...>
<mx:TextInput fontFamily="Helvetica" fontSize="12"...>
Previous Question | Next Question |
what are three ways to skin a component in flex? | What is the difference between sealed class and dynamic classes in flex? |