Formatting text with Cascading Style Sheets
143
Using style classes
You can create style “classes” that you can apply to a
<p>
or
<span>
tag using either tag’s
class
attribute. When applied to a
<p>
tag, the style affects the entire paragraph. You can also style a
span of text that uses a style class by using the
<span>
tag.
For example, the following style sheet defines two styles classes:
mainBody
and
emphasis
.
.mainBody {
font-family: Arial,Helvetica,sans-serif;
font-size: 24px;
}
.emphasis {
color: #666666;
font-style: italic;
}
Within HTML text you assign to a text field, you can apply these styles to
<p>
and
<span>
tags,
as shown below.
<p class="mainBody">This is <span class="emphasis">really exciting!</span></p>
Styling built-in HTML tags
Flash Player supports a subset of HTML tags. (For more information, see
“Using HTML-
formatted text” on page 147
.) You can assign a CSS style to every instance of a built-in HTML
tag that appears in a text field. For example, the following defines a style for the built-in
<p>
HTML tag. All instances of that tag will be styled in the manner specified by the style rule.
p {
font-family: Arial,Helvetica,sans-serif;
font-size: 12px;
display: inline;
}
The following table shows which built-in HTML tags can be styled and how each style is applied:
Style name
How the style is applied
p
Affects all
<p>
tags.
body
Affects all
<body>
tags. The
p
style, if specified, takes precedence over the
body
style.
li
Affects all
<li>
bullet tags.
a
Affects all
<a>
anchor tags.
a:link
Affects all
<a>
anchor tags. This style is applied after any
a
style.
a:hover
Applied to an
<a>
anchor tag when the mouse is hovering over the link. This style is
applied after any
a
and
a:link
style.
Once the mouse moves off the link, the
a:hover
style is removed from the link.
a:active
Applied to an
<a>
anchor tag when the user clicks the link. This style is applied after
any
a
and
a:link
style.
Once the mouse button is released, the
a:active
style is removed from the link.
Содержание FLASH MX 2004 - ACTIONSCRIPT
Страница 1: ...ActionScript Reference Guide...
Страница 8: ...8 Contents...
Страница 12: ......
Страница 24: ...24 Chapter 1 What s New in Flash MX 2004 ActionScript...
Страница 54: ...54 Chapter 2 ActionScript Basics...
Страница 80: ...80 Chapter 3 Writing and Debugging Scripts...
Страница 82: ......
Страница 110: ...110 Chapter 5 Creating Interaction with ActionScript...
Страница 112: ......
Страница 120: ...120 Chapter 6 Using the Built In Classes...
Страница 176: ......
Страница 192: ...192 Chapter 10 Working with External Data...
Страница 202: ...202 Chapter 11 Working with External Media...
Страница 204: ......
Страница 782: ...782 Chapter 12 ActionScript Dictionary...
Страница 793: ...Other keys 793 221 222 Key Key code...
Страница 794: ...794 Appendix C Keyboard Keys and Key Code Values...
Страница 798: ...798 Appendix D Writing Scripts for Earlier Versions of Flash Player...
Страница 806: ...806 Appendix E Object Oriented Programming with ActionScript 1...
Страница 816: ...816 Index...