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

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

WAP CSS Extension Properties

WAP CSS defines a number of useful extensions to CSS2. These extensions are supported by Openwave Mobile Browser 6.2.



The -wap-marquee Value for the display Property

You can use the -wap-marquee value to cause text, an image, or other content that is too wide to fit on one line on the screen to scroll across the screen, rather than wrapping to a new line.

Setting the -wap-marquee value for the display property also makes it possible to take advantage of four related WAP CSS properties, -wap-marquee-style, -wap-marquee-loop, -wap-marquee-dir, and -wap-marquee-speed, to control the manner, direction, speed, and related aspects of scrolling (these properties are described in the following sections of this chapter).

Useful For

All elements.

Inherited

No.

Notes

While you can use -wap-marquee with any element, it's really meant for block elements: If you apply it to an inline element, the affected content scrolls on a line by itself, interrupting the line in which it occurs as if it were surrounded by line breaks.

Example
li.scroll {display: -wap-marquee}

Causes all list items whose class attribute is set to scroll to scroll across the screen, rather than to wrap.



-wap-marquee-style

Controls how content scrolls across the screen.

Values

scroll, slide, alternate

Default Value

scroll

Useful For

All elements.

Inherited

No.

Notes

This property requires that the selected element also have the display property set to the -wap-marquee value.

The values have the following effect:

Example
li.slide {display: -wap-marquee; -wap-marquee-style slide}

Causes all list items whose class attribute is set to slide to slide across the screen.



-wap-marquee-loop

Controls how many times the scrolling effect repeats.

Values

An integer (0, 1, 2, and so on) or the keyword infinite.

Default Value

infinite

Useful For

All elements.

Inherited

No.

Notes

This property requires that the selected element also have the display property set to the -wap-marquee value.

Setting the value of -wap-marquee-loop to 0 has the same effect as not setting the display property to -wap-marquee.

Example
li.scroll2 {display: -wap-marquee; -wap-marquee-loop 2}

Causes all list items whose class attribute is set to scroll2 to scroll across the screen twice.



-wap-marquee-dir

Controls whether content scrolls from left to right (ltr) or from right to left (rtl).

Values

ltr, rtl

Default Value

rtl

Useful For

All elements.

Inherited

No.

Notes

This property requires that the selected element also has the display property set to the -wap-marquee value.

Example
li.slide-ltr {display: -wap-marquee; -wap-marquee-dir ltr}

Causes all list items whose class attribute is set to slide to slide left to right across the screen once.



-wap-marquee-speed

Controls the speed of the marquee effect.

Values

slow, normal, fast

Default Value

normal

Useful For

All elements.

Inherited

No.

Notes

This property requires that the selected element also have the display property set to the -wap-marquee value.

Example
li.slow {display: -wap-marquee; -wap-marquee-speed slow}

Causes all list items whose class attribute is set to slow to scroll across the screen more slowly than normal.



-wap-accesskey

Assigns a physical phone key as a shortcut for activating a form control or a link.

Values

none, one of the phone keys 0-9, *, or #

Default Value

none

Useful For

All elements.

Inherited

No.

Notes

This property is particularly useful as a shortcut for activating a form control or a link, but can also be used as a shortcut for scrolling any other element into view.

Provide users a visual hint for elements with key shortcuts. For example, if you have a list of links with key shortcuts, you can present them as an ordered list.

Pressing a key that is a shortcut for a link is the same as selecting that link on the screen and pressing the primary softkey.

For more information, see the description of the accesskey attributes in the sections describing the XHTML-MP elements <input>, <label>, and <textarea>.

If an XHTML document contains one or more <a>, <input>, <label>, or <textarea> elements that use of accesskey attribute and there is a conflict with the use of -wap-access-key in a style sheet, the style sheet key assignment takes precedence.

Example
input.send {-wap-access-key: *}

Assigns the * key as a shortcut for input elements of class send. For example:

<input class="send" type="submit" value="submit" title="Submit(*)"/>

The title of this button includes the * in parenthesis as a visual clue that the * key is a shortcut.



-wap-input-format

Sets an input mask for text input in a form.

Values

You can specify the following values for the -wap-input-format attribute:

Tag

Description

A

Any symbolic or uppercase alphabetic character (no numbers)

a

Any symbolic or lowercase alphabetic character (no numbers)

N

Any numeric character (no symbols or alphabetic characters)

X

Any symbolic, numeric, or uppercase alphabetic character (not changeable to lowercase)

x

Any symbolic, numeric, or lowercase alphabetic character (not changeable to uppercase)

M

Any symbolic, numeric, or uppercase alphabetic character (changeable to lowercase)--for multiple character input, defaults to uppercase first character

m

Any symbolic, numeric, or lowercase alphabetic character (changeable to uppercase)--for multiple character input, defaults to lowercase first character

To limit the number of characters users can enter, you can specify a single-digit number before the character tag. For example, "3X" lets the user enter a maximum of three symbolic, numeric, or uppercase alphabetic characters.

To let users enter an unlimited number of characters, specify an asterisk (*) before the character tag. For example, "*a" lets the user enter any number of symbolic or lowercase alphabetic characters.

To insert a character into the mask, use the syntax \c, replacing the c with the character you want to insert. This is useful for inserting, for example, a dash in a nine-digit area code.

Default Value

"*M"

Useful For

Text input elements, that is, <input type="text"> and <textarea>

Inherited

No.

Notes

You must enclose -wap-input-format values in quotation marks.

Example
input.zipcode9 {-wap-input-format: "NNNNN\-NNNN"}

Sets an input mask for text <input> elements whose class attribute is set to zipcode9 to accept only five digits followed by a dash followed by four digits.



-wap-input-required

Requires a user to enter text, select a button, or choose a pop-up menu item on a form.

Values

true, false

Default Value

None.

Useful For

Form input elements (see <form> for a list).

Inherited

No.

Notes

If you use -wap-input-required in a style sheet applied to an XHTML-MP form input element that also uses the emptyok attribute, the -wap-input-required value from the style sheet takes precedence.

See section 19.3.1 of the WAP CSS Specification (available from the OMA at http://www.wapforum.com) for details about combining the -wap-input-required and -wap-input-format properties.

Example
input.req {-wap-input-required: true}

Requires users to enter a value in form input elements whose class="req".