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

Section 13 out of 38 total sections
Current chapter: XHTML-MP Reference

Elements and Attributes

After the prolog and any comments, every XHTML-MP document contains a root element (<html>) that in turn contains the head (<head>) and body (<body>) of the document itself. The body is a collection of elements and their attributes, plus the contents of those elements (such as text, images, URLs, and so on).



Semantic and Presentation Elements

XHTML and CSS are designed to separate content from its presentation. In this way, you can use the same content on diverse devices, including mobile phones with a variety of font and other presentation capabilities, personal computers, and even devices for the hearing or visually impaired.

Most XHTML-MP elements are semantic elements, that is, they convey meaning about their content rather than information on how it should be displayed. For example, the <em> element contains content that should be emphasized: it's up to the browser to figure out how to render the emphasis, with a different typeface, a louder voice, or in another way.

Openwave Mobile Browser supports four XHTML-MP elements that are widely used on the web to display content in specific ways, rather than to add semantic information. These are the <b>, <i>, <big>, and <small> elements. It's best to avoid these presentation elements. For example, if you mean to emphasize text, use the <em> element and trust the browsers in your marketplace to present the content in a way that indicates emphasis; if you want to display italics, use the CSS font-style property in style sheets designed for the phones in your marketplace.



Common Attributes

Many XHTML-MP elements have five attributes in common: class, id, title, lang, and style. Because these attributes are used in mostly the same way by their elements, they are described together in Table 1-1.

Table 1-1.  Common Attributes

Attribute

Description

class

Labels the instance of the element as part of a class of elements, which can be operated on as a class by a CSS style sheet selector.

For more information, see Class Selectors.

id

Labels the instance of the element with a unique identity in the document. A style sheet selector can refer to the element. A XHTML-MP element can refer to the element for other purposes, such as identifying the target anchor of a link.

IDs must follow the rules for XML IDs:

  • They must be unique in the document.

  • They can contain only letters, numbers, and the underscore, colon, period, and hyphen symbols:
    _   :  .  -

  • They must start with a letter or the underscore symbol.

  • They may not contain spaces.

style

Specifies style properties. See Using the style Attribute to Apply Styles to Individual Elements. Also see the notes on how to use style sheets throughout this reference.

title

Labels the instance of the element with a title.

Openwave Mobile Browser does not use the title attribute, except in two cases:

  • For links, sets the primary softkey label when the link is selected. For more information, see <a>.

  • For elements in a form, sets the primary softkey label when the form element is selected. For more information, see <form>, <input>, <label>, and <textarea>.

xml:lang

Declares the human language used in the element.

Openwave Mobile Browser does not use this attribute.



<a>

The <a> ("anchor") element creates a hyperlink (or "link"), the target of a link, or both. A link can be to a document or to a specific location (a "target anchor") in the same or different document.

Openwave Mobile Browser displays links with underlined text.

You can use style sheets to change how links are displayed before and after the user has visited them. For more information, see Link Pseudo-Class Selectors.

Contents

Empty (particularly in the case of targets) or any combination of text and the following elements: <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <img>, <object>, <input>, <select>, <textarea>, <label>. Anchors can't contain additional anchors.

Attributes

class, xml:lang, style

See Common Attributes.

accesskey

A device keypad key (0-9, *, or #) that the user can press as a shortcut to selecting the link and pressing the primary softkey.

It's best to assign access keys to links and other elements in the same order as they appear in a document. For example, if you set a series of links in an ordered list (<ol>), make sure the access keys you assign to the links match the numbers that decorate the items in the list.

You can also set access keys for Openwave Mobile Browser 6.2 with the CSS -wap-accesskey property, as described in -wap-accesskey. If there is a conflict, the access key is set by the CSS property.

id

Required for target anchors.

Sets the ID of the target.

See Common Attributes for information about IDs and the rules for their contents.

The id attribute in XHTML takes the place of the name attribute, familiar to writers of HTML.

charset

Identifies the character encoding of the document referenced by the href element.

Openwave Mobile Browser does not use this attribute.

href

Required when the element is a link.

When the element is a link, identifies the target of the link. This can be an absolute or relative URL for a document, or for a target anchor in the same or different document.

hreflang

The natural language of the document referenced by the href element.

Openwave Mobile Browser does not use this attribute.

rel

Defines a link relationship from the current document to the document referenced by the href element.

Openwave Mobile Browser does not use this attribute.

rev

Defines a link relationship from the document referenced by the href element to the current document.

Openwave Mobile Browser does not use this attribute.

tabindex

Sets the element's position in the "tabbing" order in the document, that is, the order in which the input focus shifts from element to element when the user presses the key on the device that is mapped to the "tab" function.

Although the browser supports this attribute, no existing devices have assigned a key to tab, so in effect, tabindex is not used.

title

If the anchor is a link, sets the primary softkey label when the link is selected.a

type

The MIME type of the document referenced by the href element.

Openwave Mobile Browser does not use this attribute.

Notes

When the <a> element specifies a target, the id attribute is required. Target anchors are usually empty:

<a id="target-01" />

A link to a target anchor references the anchor's ID, with a pound symbol ( # ) prepended to it, for example:

<a href="#targetid">Link to a target in the same document.</a>
 
<a href="http://www.example.com/#targetid>
    Link to a target in another document.
</a>

(If you included a <base> element, relative links can resolve to another document. See <base> for more information on how that element can change how relative URLs are resolved.)

When the <a> element specifies a link, the href attribute is required.

What the browser does when the user activates a link (by selecting it and pressing the primary softkey) depends on the nature of the href value:

Example

The following two examples show how documents can contain relative links to each other.

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
      <title>Anchor 1</title>
    </head>
    <body>
      <p>This is document 1.</p>
      <p>
        <a href="a-02.html" accesskey="1" title="Go to 2">
          Go to Document 2.
        </a>
      </p>
    </body>
</html>
 
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
      <title>Anchor 2</title>
    </head>
    <body>
      <p>This is document 2.</p>
      <p>
        <a href="a-01.html" accesskey="1" title="Go to 1">
          Go to Document 1.
        </a>
      </p>
    </body>
</html>

This example includes a link to a target anchor in the same document.

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
      <title>Anchor 3</title>
    </head>
    <body>
      <p><a href="#section-03" title="Sect 3">Go to Section 3.</a></p>
 
      <p>...</p>
 
      <h1>
        <a id="section-03"/>
        Section 3
      </h1>
 
      <p>...</p>
 
    </body>
</html>



<abbr>

The <abbr> ("abbreviation") element is a semantic, inline element that contains an abbreviation.

Openwave Mobile Browser displays abbreviations in regular body text, that is, with no boldface, italics, and so on.

Contents

Empty or any combination of text and the following elements: <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <a>, <img>, <object>, <input>, <select>, <textarea>, <label>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
      <title>Abbreviation</title>
    </head>
    <body>
        <p>
          <abbr>Abbr.</abbr> is a common abbreviation
          for the word "abbreviation" itself.
        </p>
    </body>
</html>



<acronym>

The <acronym> element is an inline, semantic element that contains an acronym.

Openwave Mobile Browser displays acronyms in regular body text, that is, with no boldface, italics, and so on.

Contents

Empty or any combination of text and the following elements: <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <a>, <img>, <object>, <input>, <select>, <textarea>, <label>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
      <title>Acronym</title>
    </head>
    <body>
      <p>
        <acronym>XHTML-MP</acronym> is an acronym for
        Extensible Hypertext Markup Language, Mobile Profile.
      </p>
    </body>
</html>



<address>

The <address> element is an inline, semantic element that contains an address.

Openwave Mobile Browser displays addresses in an italic font (if one is available on the phone).

Contents

Empty or any combination of text and the following elements: <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <a>, <img>, <object>, <input>, <select>, <textarea>, <label>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
      <title>Address</title>
    </head>
    <body>
        <p>Send letters to:</p>
        <address>
            Openwave<br/>
            2100 Seaport Blvd.<br/>
            Redwood City, CA<br>
            94063
        </address>
    </body>
</html>



<b>

The <b> ("bold") element is an inline element for presenting text in a boldface font (if one is available on the phone).

It's best to avoid presentation elements, such as <b>, and use semantic elements, such as <em>, instead. For more information, see Semantic and Presentation Elements.

Contents

Empty or any combination of text and the following elements: <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <a>, <img>, <object>, <input>, <select>, <textarea>, <label>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>Bold</title>
    </head>
    <body>
        <p>The &lt;b&gt; element is convenient
        for displaying text in <b>boldface</b> type,
        but the CSS font-weight property offers more
        flexibility.</p>
    </body>
</html>



<base>

The <base> element specifies a URL against which relative URLs in the same document are resolved. It is contained in the <head> element.

Openwave Mobile Browser does not display the <base> element.

If you don't include a <base> element, relative URLs in the document are resolved against the directory that contains the current document.

Contents

Empty.

Attributes

href

Required.

An absolute or relative URL against which relative URLs in the same document are resolved.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>Base</title>
        <base href="http://www.example.com/images/"/>
    </head>
    <body>
        <p>
            <img src="logo.gif" alt="Logo"/>
        </p>
    </body>
</html>


<big>

The <big> element is an inline element for presenting text in a font that is larger than that of surrounding text (if a larger font is available on the phone).

It's best to avoid presentation elements, such as <big>, and use style sheets for changing font sizes. For more information, see Semantic and Presentation Elements.

Contents

Empty or any combination of text and the following elements: <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <a>, <img>, <object>, <input>, <select>, <textarea>, <label>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>Big</title>
    </head>
    <body>
        <p>The &lt;big&gt; element is convenient
        for displaying text in a <big>larger font</big>,
        but the CSS font-size property offers more
        flexibility.</p>
    </body>
</html>



<blockquote>

The <blockquote> element is a block-level, semantic element for identifying and displaying a quotation. It's typically used for long quotations (for short quotations, use the inline element <q> (see <q>).

Openwave Mobile Browser presents the contents of the <blockquote> element as one or more indented paragraphs.

Contents

One or more of the following elements: <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <ul>, <ol>, <dl>, <p>, <div>, <pre>, <blockquote>, <address>, <hr>, <table>, <form>, <fieldset>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

cite

A URL for the source of the quotation, bibliographic information, or related information about the quotation.

If you include the cite attribute, the quotation is displayed as a link. (For more information about links, see <a>.)

Notes

You can use the CSS link pseudo-class selectors to change how the browser displays URLs in the <blockquote> element. See Link Pseudo-Class Selectors.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>Blockquote</title>
    </head>
    <body>
        <p>The W3C mission:</p>
        <blockquote cite="http://www.w3.org">
            <p>...develop interoperable technologies
            (specifications, guidelines, software, and
            tools) to lead the Web to its full potential.</p>
        </blockquote>
    </body>
</html>



<body>

The <body> element contains the elements, text, images, and other content that make up the main body of the document. The <body> element is contained in the root element (<html>).

Contents

One or more of the following elements: <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <ul>, <ol>, <dl>, <p>, <div>, <pre>, <blockquote>, <address>, <hr>, <table>, <form>, <fieldset>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

Example

The <body> element is shown in all examples in this document.



<br>

The <br> ("break") element is an inline element that forces any content that follows it to start on a new line, without starting a new block of content.

You can use the clear attribute to specify where text should continue when it is interrupted by an image or other object.

Contents

Empty.

Attributes

class, id, title, style

See Common Attributes.

clear

left | right | all | none

Specifies where text should continue.

Openwave Mobile Browser supports this legacy attribute as an extension to XHTML-MP, to provide an alternative to the WCSS clear and float properties.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>Break</title>
    </head>
    <body>
      <p>
         <img style="text-align: left" src="images/4birds.gif"/>
         <img style="text-align: right" src="images/6birds.gif"/>
         Using the clear attribute, <br clear="left"/>
         you can control how text <br clear="right"/>wraps
         around images and other objects.
      </p>
    </body>
</html>

Also see the example for <address>.



<caption>

The <caption> element contains the caption for a table. It is contained by the <table> element.

Openwave Mobile Browser presents captions in a boldface font (if one is available on the phone), centered on their own lines above their associated tables.

Contents

Empty or any combination of text and the following elements: <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <a>, <img>, <object>, <input>, <select>, <textarea>, <label>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

Example

See the example for <table>.



<cite>

The <cite> element is an inline, semantic element for identifying a citation or reference to a book, web site, document, or other work.

Openwave Mobile Browser displays citations in italics, if an italic font is available on the phone.

Contents

Empty or any combination of text and the following elements: <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <a>, <img>, <object>, <input>, <select>, <textarea>, <label>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>Citation</title>
    </head>
    <body>
        <p>
            This <cite>XHTML Mobile Profile Reference</cite>
            contains details about XHTML-MP and CSS.
        </p>
    </body>
</html>



<code>

The <code> element is an inline, semantic element for identifying and presenting text that is computer code. This element is best used for short code fragments; for longer code listings, particularly if you want to preserve spaces and carriage returns, use the block element <pre> (see <pre>).

Openwave Mobile Browser presents code in a monospace font (if one is available on the phone).

Contents

Empty or any combination of text and the following elements: <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <a>, <img>, <object>, <input>, <select>, <textarea>, <label>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>Code</title>
    </head>
    <body>
        <p>Use the <code>&lt;code&gt;</code> element for
        short excerpts of computer code.</p>
    </body>
</html>



<dd>

The <dd> (definition list, definition) element contains the definition of a definition list term (<dt>). Both the term and its definition are contained in a definition list (<dl>). For more information, see <dl>.

Contents

Empty or any combination of text and the following elements: <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <ul>, <ol>, <dl>, <p>, <div>, <pre>, <blockquote>, <address>, <hr>, <table>, <form>, <fieldset>, <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <a>, <img>, <object>, <input>, <select>, <textarea>, <label>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.



<dfn>

The <dfn> ("definition") element is a semantic, inline element that indicates that the enclosed term or phrase is defined at this location in a document.

Openwave Mobile Browser presents definitions in an italic font (if one is available on the phone).

Contents

Empty or any combination of text and the following elements: <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <a>, <img>, <object>, <input>, <select>, <textarea>, <label>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>Definition</title>
    </head>
    <body>
        <p>Use the <dfn>definition</dfn> element
        to indicate that the enclosed term or phrase
        is defined at this location in a document.</p>
    </body>
</html>



<div>

The <div> ("division") element contains one or more blocks of text, images, and other content that make up a section of a document. You usually use <div> to apply style rules to a section of a document.

The <div> element is most useful for delineating sections of one or more block elements (headings, paragraphs, lists, tables, and so on) in a document; use <span> to delineate sections within a block element (see <span>).

Contents

Empty or any combination of text and the following elements: <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <ul>, <ol>, <dl>, <p>, <div>, <pre>, <blockquote>, <address>, <hr>, <table>, <form>, <fieldset>, <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <a>, <img>, <object>, <input>, <select>, <textarea>, <label>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>Division</title>
    </head>
    <body>
        <div style="text-align: center">
            <h1>Introduction</h1>
            <p>Introductory text...</p>
        </div>
        <hr/>
        <div style="text-align: left">
            <h1>Chapter 1</h1>
            <p>First chapter text...</p>
        </div>
    </body>
</html>



<dl>

The <dl> ("definition list") element is a semantic, block element that creates and presents a list of terms (contained in the <dt> element) and their definitions (contained in the <dd> element).

Openwave Mobile Browser displays list terms and definitions in plain (roman) text, with the definitions indented.

Contents

One or more <dt> and <dd> elements (typically in term-definition pairs).

Attributes

class, id, style, title, xml:lang

See Common Attributes.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>Definition List</title>
    </head>
    <body>
        <dl>
        	 <dt>XHTML-MP</dt>
        	 <dd>Extensible Hypertext Markup Language, Mobile Profile</dd>
        	 <dt>CSS</dt>
        	 <dd>Cascading Style Sheets</dd>
        </dl>
    </body>
</html>



<dt>

The <dt> ("definition list, term") element contains a term in a definition list (<dl>). The definition list contains both the term and its definition (<dd>). For more information, see <dl>.

Contents

Empty or any combination of text and the following elements: <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <a>, <img>, <object>, <input>, <select>, <textarea>, <label>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.



<em>

The <em> ("emphasis") element is a semantic, inline element that indicates its content should be presented with emphasis.

Openwave Mobile Browser presents emphasized text in a bold-italic font (if one is available on the phone).

Contents

Empty or any combination of text and the following elements: <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <a>, <img>, <object>, <input>, <select>, <textarea>, <label>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>Emphasis</title>
    </head>
    <body>
        <p>Highway Conditions:</p>
        <p>101: Normal</p>
        <p>280: <em>Delays</em></p>
        <p>880: Normal</p>
    </body>
</html>



<fieldset>

The <fieldset> element is a block element groups related elements for quick visual scanning. You most commonly use it to create groups of elements in a form (see <form>).

Openwave Mobile Browser draws a horizontal rule above and below the contents of the <fieldset> element.

Contents

Empty or any combination of text and the following elements: <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <ul>, <ol>, <dl>, <p>, <div>, <pre>, <blockquote>, <address>, <hr>, <table>, <form>, <fieldset>, <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <a>, <img>, <object>, <input>, <select>, <textarea>, <label>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
    <title>Fieldset</title>
  </head>
  <body>
    <form action="http://www.example.com/adduser" method="get">
      <p>
        About You
      </p>
        <fieldset>
          <p>Your initials:</p>
            <label>First:
              <input type="text" name="first" size="1"
               title="First"/>
            </label>
            <label>Last:
                <input type="text" name="last" size="1"
                 title="Last"/>
            </label>
        </fieldset>
      <label>Your age:
          <input type="text" name="age" size="3"
           title="Age"/>
      </label>
      <p>
        <input type="submit"/>
        <input type="reset"/>
      </p>
    </form>
  </body>
</html>



<form>

The <form> element is a block element for collecting user information that the browser can send to a URL. The URL is typically for a Common Gateway Interface (CGI) or other web-based application designed to collect the information that the user enters. Forms are built from combinations of the <input>, <label>, <optgroup>, <select>, and <textarea> elements (although each of these must be contained in a valid child element of <form>, such as <p>, <fieldset>, or <table>).

The <form> element must include an action specifying the URL of the application that receives the contents of the form.

A <form> element cannot contain another <form> element.

Contents

One or more of the following elements: <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <ul>, <ol>, <dl>, <p>, <div>, <pre>, <blockquote>, <address>, <hr>, <table>, <fieldset>. (These in turn can contain the form elements themselves.)

Attributes

class, id, style, title, xml:lang

See Common Attributes.

action

Required.

The URL where the browser sends the form data when the user presses the submit button.

enctype

The MIME type used to encode the content of the form.

For more information about MIME types in forms, see section 17.13.4 of the W3C "HTML 4.01 Specification" (http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4).

method
get | post

The HTTP method for passing the form data to the web server. The default method is get.

When you use method="get", the browser appends the form data to the URL in the HTTP request header. Don't use method="get" if your form collects non-ASCII characters, or if the form data can exceed 100 characters: Use method="post" instead.

With method="post", the browser sends the form data in the body of the HTTP request.

Example

See the examples for <fieldset>, <input>, <optgroup>,<select>, and <textarea>.



<h1> to <h6>

The <h1>, <h2>, <h3>, <h4>, <h5>, and <h6> ("level 1 heading" through "level 6 heading") elements are block elements that contain headings.

Openwave Mobile Browser displays the higher-level headings (those with lower numbers) in bolder, larger fonts than lower-level headings (depending on the fonts available on the phone).

Contents

Empty or any combination of text and the following elements: <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <a>, <img>, <object>, <input>, <select>, <textarea>, <label>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
    <title>Headings</title>
  </head>
  <body>
    <h1>1 Head</h1>
    <p>Body text</p>
    <h2>2 Head</h2>
    <h3>3 Head</h3>
    <h4>4 Head</h4>
    <h5>5 Head</h5>
    <h6>6 Head</h6>
  </body>
</html>



<head>

The <head> element contains the title and other elements that describe the document and how the browser should display it. For more information on these elements, see <base>, <link>, <meta>, <object>, <style>, and <title> (all XHTML-MP documents must contain a <title> element). The <head> element is contained in the root element (<html>).

Content

Must contain one <title> element; may also contain a single <base> element; may also contain any number of the following elements: <meta>, <link>, <object>, <style>.

Attributes

xml:lang

See Common Attributes.

profile

Metainformation about the document.

Openwave Mobile Browser does not use this attribute.

Example

The <head> element is shown in all examples in this reference.



<hr>

The <hr> ("horizontal rule") element inserts a horizontal rule (or line) in the document.

Openwave Mobile Browser displays the horizontal rule as a solid, gray line.

You can use style sheets to set the width, color, and other attributes of the line.

Content

Empty.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

size

The thickness of the rule.

This legacy HTML attribute is an extension to XHTML-MP.

width

The width of the rule.

This legacy HTML attribute is an extension to XHTML-MP.

Example

See the example for <div>.



<html>

The <html> element indicates the start and end of an XHTML-MP document: It is the root element, as declared in the DOCTYPE declaration in the prolog (for more information, see Prolog Components).

Content

One <body> element and one <head> element.

Attributes

xml:lang

See Common Attributes.

version

The HTML DTD version used in the document. Because the DOCTYPE declaration includes version information about the DTD used, this attribute is deprecated.

xmlns

Required with the value:

http://www.w3.org/1999/xhtml

The XML namespace used by XHTML.

Example

The <html> element is shown in all examples in this document.



<i>

The <i> ("italics") element is an inline element for presenting text in an italic font (if one is available on the phone).

It's best to avoid presentation elements, such as <i> and use semantic elements, such as <em>, instead. For more information, see Semantic and Presentation Elements.

Contents

Empty or any combination of text and the following elements: <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <a>, <img>, <object>, <input>, <select>, <textarea>, <label>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>Italics</title>
    </head>
    <body>
        <p>The &lt;i&gt; element is convenient
        for displaying text in <i>italic</i> type,
        but the CSS font-style property offers more
        flexibility.</p>
    </body>
</html>



<img>

The <img> ("image") element specifies how to insert an image in a document.

You can use <img> to display a graphics file, by referencing its URL with the src attribute. You can also use the localsrc attribute of <img> to insert one of the hundreds of icons included with Openwave Mobile Browser.

Content

Empty.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

alt

Required.

Alternative text displayed if the image can't be displayed (for example, because the file can't be found or the device doesn't support the file's image format).

In some cases, you can use images "drawn" with text characters instead of alternative text. For example, use (alt="-&gt;") for a right-pointing arrow ( -> ).

height

The image height, in pixels.

The browser scales the image to match the height you set.

localsrc

A WML extension to XHTML-MP for displaying one of the hundreds of Openwave icons and WAP pictograms included with Openwave Mobile Browser on the phone.

You can reference icons by name or number. For example, <img localsrc="78" alt="bird" src="" /> is the same as <img localsrc="bird" alt="bird" src="" />.

When inserting an icon with the localsrc attribute, you can use the src attribute to specify the URL of an alternative icon, or you can use a null value (src="").

See Appendix A, Openwave Mobile Browser Icons, and Appendix B, WAP Pictograms, for a table of available icons and their names and numbers, along with the details on their syntax.

longdesc

A URL for a document that contains a long description of the image.

Openwave Mobile Browser does not use this attribute.

src

Required.

The URL of the image to insert.

Although this attribute is required, you can give it a null value (src="").

width

The image width in pixels.

The browser scales the image to match the width you set.

Notes

Openwave Mobile Browser supports the display of images in BMP, GIF, JPEG, PNG, WBMP, and WPNG formats. However, some phones don't support all these formats.

Example

This example imports a GIF image.

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>Images 1</title>
    </head>
    <body>
      <p>
         <img src="images/logo.gif" alt="Logo" />
         The browser supports a number of image formats.
      </p>
    </body>
</html>

This example uses the localsrc attribute to insert six Openwave Mobile Browser icons.

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>Images 2</title>
    </head>
    <body>
      <p>
        <img src="" localsrc="moon2" alt="moon"/> -
        <img src="" localsrc="star2" alt="star" /><br/>
        <img src="" localsrc="day" alt="day"/> -
        <img src="" localsrc="scissors" alt="scissors"/><br/>
        <img src="" localsrc="creditcard" alt="creditcard"/> -
        <img src="" localsrc="110" alt="movie camera" />
      <p>
    </body>
</html>



<input>

The <input> element is used to create text fields, buttons, and related components of a form. When the user completes the form and presses its Submit button, the data is transmitted to the server specified in the <form> elements's action attribute, using the HTTP method (get or post) specified in the <form> element's method attribute (for more information, see <form>).

Content

Empty.

Attributes

class, id, xml:lang, style

See Common Attributes.

accesskey

A device keypad key (0-9, *, or #) that the user can press as a shortcut to selecting the input element and pressing the primary softkey.

If the input element is a text field, pressing its access key places an insertion point at the end of any text in the field and puts the user in text-entry mode.

If the element is a radio button, pressing the access key is a shortcut for selecting that button.

If the element is a checkbox, pressing the access key is a shortcut for checking or unchecking it.

If the element is a Submit or Reset button, pressing its access key is a shortcut for pressing that button (for example, pressing the Submit button's access key submits the form).

You can also set access keys for Openwave Mobile Browser 6.2 with the CSS -wap-accesskey property, as described in -wap-accesskey. If there is a conflict, the access key is set by the CSS property.

checked

checked

Specifies that an option button or a checkbox is checked when the form first loads, or when the user presses the form's Reset button. If this attribute isn't used for a group of option buttons, none of them is checked.

disabled

disabled

Prevents the user from selecting the input element to enter text, select the option, and so on.

This attribute is an XHTML extension to XHTML-MP.

emptyok

true | false

The default is true.

Specifies whether the user can leave the field blank (true) or not (false).

This attribute is a WML extension to XHTML-MP.

See -wap-input-required for details on using that CSS property to require users to enter information in a form. In case of a conflict, the CSS property takes precedence.

maxlength

Use with type="text" and type="password" to set the maximum number of characters the user can enter in the field.

name

The name portion of the name-value pair for the input element (the name-value pair is sent to the web server when the user presses the Submit button).

To create a group of radio or checkbox buttons, give them the same name attribute. The browser prevents users from selecting more than one radio button in a group. Users can check more than one checkbox in a group.

readonly

readonly

Prevents the user from entering text.

This attribute is a WML extension to XHTML-MP.

size

Use with type="text" and type="password" to set the width of the field, in characters.

src

Use with type="submit" and type="reset" to set the URL of an image to use as the label for the button, instead of text.

If the image can't be displayed, the browser displays the text set by the value element. If neither is available, the browser displays the default text for the button ("Submit" or "Reset").

tabindex

The element's position in the "tabbing" order in the document, that is, the order in which the input focus shifts from element to element when the user presses the key on the device that is mapped to the "tab" function.

Although the browser supports this attribute, no existing devices have assigned a key to tab, so in effect, tabindex is not used.

title

The primary softkey label when the element is selected.

For text and password fields, use "Edit" or a similar title to describe the effect of pressing the softkey.

For radio buttons and checkboxes, use a title that reflects the value when the button is checked.

For Submit or Reset buttons, use "Submit," "Reset," or another title that describes the effect of pressing the button.

type
checkbox | hidden | password | radio | reset | submit | text

The type of input element.

If you don't specify the type, the default is text.

value

For type="checkbox" and type="radio", specifies the value portion of the name-value pair sent to the server if the option is selected when the user submits the form.

For type="submit" and type="reset", specifies text to display in the button in place of the default text (that is, "Submit" and "Reset," which are displayed if you don't include a value or src argument).

For type="hidden", type="password", and type="text", specifies the default value of the control. The default value is displayed as text in a text field and as asterisks in a password field.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
    <title>Input</title>
  </head>
  <body>
    <h4>Joe from Joe's!</h4>
    <form action="http://www.example.com/coffee.cgi" method="post">
      <p>
        <label>Name:
          <input type="text" name="name" size="8" maxlength="8"
           emptyok="false" title="Edit"/>
        </label>
      </p>
      <p>
        <label>Lg
          <input type="radio" name="size" value="large"
           checked="checked" title="Large"/>
        </label>
        <label>Md
            <input type="radio" name="size" value="medium"
             title="Medium" disabled="disabled"/>
        </label>
        <label>Sm
            <input type="radio" name="size" value="small"
             title="Small"/>
        </label>
      </p>
      <p>
        <label>Cream
          <input type="checkbox" name="condiment" value="cream"
          title="Cream?"/>
        </label>
        <label>Sugar
          <input type="checkbox" name="condiment" value="sugar"
           title="Sugar?"/>
        </label>
      </p>
      <p>
        <input type="submit" src="images/mug.gif" value="Order"
         title="Order"/>
        <input type="reset" value="Start Over" title="Clear"/>
      </p>
      <p>
        <input type="hidden" name="formid" value="C-003" />
      </p>
    </form>
  </body>
</html>

In this example, if a user enters Joe in the Name field, selects Lg (default button), checks the Sugar and Cream boxes, and presses the mug button, the browser submits the following in the body of the HTTP Post transaction to the server at http://www.example.com/coffee.cgi:

name=Joe&size=lg&condiment=cream&condiment=sugar&formid=C-003

The customer is required to enter his or her name. Joe's is out of medium-sized mugs.



<kbd>

The <kbd> element is an inline element for presenting user-entry text.

Openwave Mobile Browser displays text in the <kbd> element in a monospace font (if one is available on the phone).

Contents

Empty or any combination of text and the following elements: <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <a>, <img>, <object>, <input>, <select>, <textarea>, <label>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

Example
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
      "http://www.openwave.com/dtd/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>Keyboard</title>
    </head>
    <body>
        <p>If you are the first to arrive, enter <kbd>First</kbd> in the field and click Open.</p>
    </body>
</html>



<label>

The <label> element contains a label for an <input>, <select>, or <textarea> element in a form.

Contents

Empty or any combination of text and the following elements: <input>, <select>, <textarea>, <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <img>, <object>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

accesskey

A device keypad key (0-9, *, or #) that the user can press as a shortcut to selecting the input element and pressing the primary softkey.

You can also set access keys for Openwave Mobile Browser 6.2 with the CSS -wap-accesskey property, as described in -wap-accesskey. If there is a conflict, the access key is set by the CSS property.

for

The ID of the element to be labeled.

Example

See the examples for <input> and <option>.



<li>

The <li> ("list item") element contains an item in an ordered list (see <ol>) or an unordered list (see <ul>).

Contents

Empty or any combination of text and the following elements: <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <ul>, <ol>, <dl>, <p>, <div>, <pre>, <blockquote>, <address>, <hr>, <table>, <form>, <fieldset>, <br>, <span>, <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, <cite>, <abbr>, <acronym>, <q>, <i>, <b>, <big>, <small>, <a>, <img>, <object>, <input>, <select>, <textarea>, <label>.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

value 

The item's number in an ordered list. Subsequent items in that list are numbered sequentially from value, unless you use value again.

Example

See the examples for <ol> and <ul>.



<link>

The <link> element associates an external resource with the current document. It is contained in the <head> element.

The <link> element has two usual purposes:

Content

Empty.

Attributes

class, id, style, title, xml:lang

See Common Attributes.

charset

The character encoding of the document referenced by the href element.

Openwave Mobile Browser does not use this attribute.

href

Required.

Sets the URL of the external resource.

hreflang

The natural language of the document referenced by the href element.

Openwave Mobile Browser does not use this attribute.