| Flex 2 Developer's Guide > Customizing the User Interface > Using Styles and Themes > Using local style definitions | |||
The <mx:Style> tag contains style sheet definitions that adhere to the CSS 2.0 syntax. These definitions apply to the current document and all children of the current document. The <mx:Style> tag uses the following syntax to define local styles:
<mx:Style>
selector_name {
style_property: value;
[...]
}
</mx:Style>
The following example defines a class and a type selector in the <mx:Style> tag:
<?xml version="1.0"?>
<!-- styles/CompoundLocalStyle.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Style>
.myFontStyle {
fontSize: 15;
color: #9933FF;
}
Button {
fontStyle: italic;
}
</mx:Style>
<mx:Button id="myButton" styleName="myFontStyle" label="Click Here"/>
</mx:Application>
Flex 2.01