Creating Css Styles In Stylesheets - Adobe GOLIVE CS2 User Manual

Hide thumbs Also See for GOLIVE CS2:
Table of Contents

Advertisement

Creating CSS styles in stylesheets

Types of CSS styles
You can create new CSS styles from scratch or import CSS styles from an external stylesheet. There are four different
types of styles you can define in a stylesheet:
HTML element styles
Are "hard-wired" to specific HTML tags. This means the style properties automatically apply
to a tag, and any content it might enclose, wherever the tag appears in a web page. This style type lets you display
pages in CSS-enabled browsers exactly as you want them to appear. Simultaneously, browsers with no CSS-support,
or incomplete CSS-support, will have the benefit of the HTML-based formatting that is inherent in the tag you
specify in the style name. For example, if an HTML element style is named for the <h3> tag, any style properties you
add to the style will be applied to any text that uses the Header 3 paragraph format in the page when viewed in CSS­
enabled browsers. Browsers without CSS-support will display the text using the default Header 3 text properties.
Class styles
Apply to selected text or objects in a document, similar to the way word processor styles function. Any
number of elements inside the BODY section of a page can host a class style. If you modify the class style's properties,
the changes affect all text and objects to which the style was applied. Class styles are more flexible than HTML
element styles because a class style can be applied to multiple types of content and only to items you select. For
example, you can apply a class style to some of the headings that use the Header 4 paragraph format in a page to
distinguish them from other Header 4 headings in the page.
Define unique style properties for one element on a page. This style type is used if the style properties of
ID styles
an item must be distinct from all other items on the page. Consider using a class style instead since it can also be
applied to a single item and is more flexible.
Inline styles
Apply to specific elements on the page and add a style attribute to HTML tags. You create and apply
inline styles by using style-attribute editing in the CSS Editor. Because inline styles apply to specific elements on the
page, you can use them only in internal stylesheets.
Two major style categories are used with cascading stylesheets:
Simple Styles
Match elements based on the element type, attributes, for both, but not the element's position in the
document structure. H1 (all level 1 headers) and H1.headline (all level 1 headers with the CLASS attribute.headline)
are examples of simple styles.
Match elements based on their position in the document structure. A contextual style consists of
Contextual Styles
several simple styles. H1.headline B (all level 1 headers with the CLASS attribute .headline and bold typeface) is an
example of a contextual style consisting of two simple selectors, H1.headline and B.
To import styles from an external stylesheet
You can import styles from an external stylesheet into a web page's internal stylesheet.
1
Open the CSS Editor for the page to which you want to import the CSS styles.
Choose File > Import > External Style Sheet.
2
3
Select an external stylesheet, and click Open. The external stylesheet's styles are added to the list of internal styles
in the CSS Editor.
ADOBE GOLIVE CS2
325
User Guide

Advertisement

Table of Contents
loading

Table of Contents