3.5. <wml> Element

<wml> is the root element of WML. All other elements should be enclosed within the <wml></wml> tags.


3.6. <card> Element

The <card> element specifies the content of a card. There are two cards in our Hello World WML example. As you can see in the earlier screenshots, only one card is displayed at a time. We will discuss how to navigate from one card to another when we talk about anchor links later in this tutorial.

In our Hello World WML example, two attributes, id and title, have been specified to the <card> tag. We use the id attribute to define a unique ID for a card. Card IDs are needed for navigation between cards. However, the id attribute has no use in the Hello World WML example and it is OK to remove it.

The title attribute is used to set the title of a card. Typically, a title is displayed at the top of a wireless device's screen. Most WAP browsers display the title of a card, although a few very old ones do not. If the title is too long, WAP browsers will truncate the title to match the size of the title bar.

Unlike HTML 4.01 Transitional, text cannot be enclosed directly in the <card></card> tag pair. For example, the following markup code is incorrect in WML:


<card id="card1" title="WML Tutorial">
  Hello world. Welcome to our WML tutorial.
</card>


To correct the above WML markup code, enclose the text in <p></p> tags. The following markup code is the correct version of the previous one:


<card id="card1" title="WML Tutorial">
  <p>Hello world. Welcome to our WML tutorial.</p>
</card>


Previous Page Page 5 of 50 Next Page


Feedback Form (ExpandCollapse)

What do you think about this web page?






(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Please enter again to confirm:

Due to the amount of messages we received, we may not be able to reply to all messages.

A button for going back to the top of this page