
Inserting and Formatting Text
249
CSS style sheets reside in the
head
area of a document. CSS styles can define the
formatting attributes for HTML tags, ranges of text identified by a
class
attribute, or text that meets criteria conforming to the Cascading Style Sheets
(CSS) specification. Dreamweaver recognizes styles defined in existing documents
as long as they conform to CSS style guidelines.
CSS style sheets work in 4.0 and later browsers. Internet Explorer 3.0 recognizes
some CSS style sheets, but most earlier browsers ignore them.
Three types of CSS style sheets are available in Dreamweaver:
•
Custom CSS styles are similar to the styles you use in a word processor, except
that there is no distinction between character and paragraph styles. You can
apply CSS custom styles to any range or block of text. If the CSS style is
applied to a block of text (such as an entire paragraph or unordered list), a
class
attribute is added to the block’s tag (for example,
p class="myStyle"
or
ul class="myStyle"
). If the CSS style is applied to a range of text,
span
tags containing the
class
attribute are inserted around the selected text. See
“Applying a custom (class) CSS style” on page 254.
•
HTML tag styles redefine the formatting for a particular tag, such as
h1
. When
you create or change a CSS style for the
h1
tag, all text formatted with the
h1
tag is immediately updated.
Note:
Be careful when redefining tags in a linked CSS, as this can change the layout of
many pages. For example, if you redefine the
table
tag to look a certain way, it will alter
the layout of other pages using tables.
•
CSS selector styles redefine the formatting for a particular combination of tags
(for example,
td h2
applies whenever an
h2
header appears inside a table cell)
or for all tags that contain a specific
id
attribute (for example,
#myStyle
applies to all tags that contain the attribute-value pair
ID="myStyle"
).
Manual HTML formatting overrides formatting applied with CSS (or HTML)
styles. For CSS styles to control the formatting of a paragraph, you must remove
all manual HTML formatting or HTML styles.
Although you can set an unlimited number of CSS style attributes defined by the
CSS1 specification in Dreamweaver, not all of the attributes appear in the
Document window. The attributes that do not appear are marked with an asterisk
(*) in the Style Definition dialog box. Note also that some of the CSS style
attributes that you can set with Dreamweaver appear differently in Microsoft
Internet Explorer 4.0 and Netscape Navigator 4.0, and some are not currently
supported by any browser.
Note:
To display the O’Reilly CSS reference guide included with Dreamweaver, click
the Reference button found on the toolbar and choose O’Reilly CSS Reference from
the pop-up menu.
Содержание 38028779 - Macromedia Dreamweaver - Mac
Страница 1: ...macromedia Using Dreamweaver...
Страница 148: ...Chapter 4 148...
Страница 296: ...Chapter 12 296...
Страница 472: ...Chapter 18 472...
Страница 512: ...Chapter 21 512...
Страница 562: ...Appendix 562...