About styles

You modify the appearance of Flex components through style properties. These properties can define the size of a font used in a Label control, or the background color used in the Tree control. In Flex, some styles are inherited from parent containers to their children, and across style types and classes. This means that you can define a style once, and then have that style apply to all controls of a single type or to a set of controls. In addition, you can override individual properties for each control at a local, component, or global level, giving you great flexibility in controlling the appearance of your applications.

This section introduces you to applying styles to controls. It also provides a primer for using Cascading Style Sheets (CSS), an overview of the style value formats (Length, Color, and Time), and describes style inheritance. Subsequent sections provide detailed information about different ways of applying styles in Flex.

Flex does not support controlling all aspects of component layout with CSS. Properties such as x, y, width, and height are properties, not styles, of the UIComponent class and, therefore, cannot be set in CSS. Other properties, such as left, right, top, and bottom are style properties and are used to manipulate a component's location in a container.

Subtopics

Using styles in Flex
Setting global styles
About style value formats
Using Cascading Style Sheets
About style inheritance

Flex 2.01

Take a survey