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

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

Visual Formatting Properties

The visual formatting properties control such display aspects as the width and height of content and whether it's displayed at all.



display

You can use the display property to suppress the display of the content of selected elements.

With Openwave Mobile Browser 6.2, you can also use the display property to take advantage of some extensions to the CSS2 specification for controlling how lines of text are displayed, as described in The -wap-marquee Value for the display Property, and the sections that follow it.

Values

none, -wap-marquee

Default Value

Depends on the XHTML element.

Useful For

All elements.

Inherited

No.

Notes

Setting the display property to none causes the browser to ignore the selected element, and its content and nested elements, when displaying the document on screen.

Example
p.hidden {display: none}

Hides the content of any paragraphs whose class attribute is set to hidden.



float

Openwave Mobile Browser does not use this WCSS property.

See <br> for information on extensions to XHTML-MP that you can use to achieve a comparable effect.



clear

Openwave Mobile Browser does not use this WCSS property.

See <br> for information on extensions to XHTML-MP that you can use to achieve a comparable effect.



width

Sets the width of content.

Values

em, ex, cm, mm, in, pt, pc, px, %, auto, inherit

For more information, see Units of Measure, Percentage, and Keywords.

Default Value

auto

Useful For

Block elements and inline "replaced elements," that is, elements such as <img>, <object>, and form controls that the browser replaces with an image, UI control, or other object.

Inherited

No.

Example
blockquote {width: 1.5in}

Sets the width of block quotes to 1.5 inches.



height

Sets the height of content.

Values

em, ex, cm, mm, in, pt, pc, px, %, auto, inherit

For more information, see Units of Measure, Percentage, and Keywords.

Default Value

auto

Useful For

Block elements and inline "replaced elements," that is, elements such as <img>, <object>, and form controls that the browser replaces with an image, UI control, or other object.

Inherited

No.

Example
img.ourlogo {height: 70px}

Sets a 70-pixels height for all images whose class="ourlogo".



line-height

For block elements, sets the minimum height of each line; for inline elements, sets the exact height of the line.

Values

normal, em, ex, cm, mm, in, pt, pc, px, %, a number, inherit

For more information, see Units of Measure, Percentage, and Keywords.

Default Value

normal

Useful For

All elements.

Inherited

Yes.

Notes

The normal keyword allows the browser to calculate a sensible line height.

A numeric value is a multiple of the current font size, that is, if the current font size is 10 points, a line-height value of 1.2 sets the line height to 12 points.

Example
p {line-height: 1.2em}

Sets the minimum line height for paragraphs to 1.2 ems, that is, 1.2 times the current font size (1.2em is equivalent to the values 120% and 1.2).



vertical-align

Vertically aligns the content of inline elements and table cells.

Values

baseline, sub, super, top, middle, bottom, inherit

Default Value

baseline

Useful For

Inline elements and table cells.

Inherited

No.

Notes

The values have the following effect:

For more information about how cells are aligned in a row, see section 17.5.3, "Table Height Algorithms," in the W3C CSS2 specification.

Example

span.tm {vertical-align: super; font-size: smaller}

Uses a superscripted, smaller font for text contained by a <span> element whose class attribute is tm. For example:

<p>Openwave<span class="tm">TM</span> Mobile Browser</p>