<wml> Element

Preferences - Do not show ads

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


<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>


Page 5 of 50 Previous Page | Next Page
Contents at a Glance
Print this Web Page | | Back to Top

Feedback Form (Expand)

What do you think about this web page?






WML Tutorial Table of Contents WML Tutorial Contents at a Glance Preferences - Change Color Scheme Preferences - Do Not Show Ads Previous Page Next Page