![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
Cascading Style Sheets are a mechanism for creating text styles that can be applied to HTML or XML documents. A style sheet is a collection of formatting rules that specify how to format HTML or XML elements. Each rule associates a style name, or selector, with one or more style properties and their values. For example, the following style defines a selector named bodyText
.
bodyText { text-align: left}
You can create styles that redefine built-in HTML formatting tags used by Flash Player (such as <p>
and <li>
), create style "classes" that can be applied to specific HTML elements using the <p>
or <span>
tag's class
attribute, or define new tags.
You use the TextField.StyleSheet class to work with text style sheets. You can load styles from an external CSS file or create them natively using ActionScript. To apply a style sheet to a text field that contains HTML- or XML-formatted text, you use the TextField.styleSheet
property. The styles defined in the style sheet are mapped automatically to the tags defined in the HTML or XML document.
Using styles sheets involves three basic steps:
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |