Openwave Mobile Browser 6.1 and 6.2: XHTML Mobile Profile and CSS Reference

Section 15 out of 38 total sections
Current chapter: CSS Reference

CSS Syntax

A Cascading Style Sheet (CSS) is a set of one or more statements that specify how content should be displayed by a browser. Each statement describes how to display the content of one or more XHTML-MP elements (a rule set) or uses the @import at-rule to import an external style sheet (@import rules are described in Using @import Rules to Apply an External Style Sheet).

Each CSS style rule contains a selector and a declaration. The selector defines what elements the rule applies to. The declaration contains one or more properties, each of which may have one or more values, specifying how the content of the selected elements should be displayed. For example, this is the pattern for a style rule with two selectors and two properties, with a primary and backup value for the second value:

selector1, selector2 {property1: value1; property2: value1, value2}

CSS selectors are described in Selectors. CSS properties are described in the second part of this chapter, by group, starting with Margin Properties.

Style sheets can be stand-alone text files, components of the <head> element in an XHTML-MP document, or attributes of XHTML-MP elements, as described in Applying Style Sheets to Documents.