
TUTORIALS POINT
Simply Easy Learning Page 31
Flex – Style With CSS
This chapter describes the styles under Adobe Flex:
F
lex supports the use of CSS syntax and styles to apply styles to its UI controls in the same way as CSS to
HTML components.
Way #1: Using external style sheet file
You can refer to a style sheet available in the class path of the application. For example consider Style.css file
in com/tutorialspoint/client folder where HelloWorld.mxml file also lies.
/* CSS file */
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
...
.container {
cornerRadius :10;
horizontalCenter :0;
borderColor: #777777;
verticalCenter:0;
backgroundColor: #efefef;
}
Then css file can be referred by following code snippet
<fx:Style source="/com/tutorialspoint/client/Style.css"/>
Assign styles to UI component using styleName property
<s:BorderContainer width="500" height="500" id="mainContainer"
styleName="container">
...
</s:BorderContainer>
Way #2: Using styles within UI container component
Commentaires sur ces manuels