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 |
- 1. WML (Wireless Markup Language) Introduction
- 2. WML Deck and Card
- 3. WML Document Structure
- 4. WML Generic Metadata: <meta>
- 5. Comments in WML
- 6. Line Breaking in WML
- 7. Font Size and Style in WML
- 8. WML Preformatted Text: <pre>
- 9. WML Images
- 10. WML Tables
- 11. WML Anchor Links
- 12. Programming Softkeys of Mobile Phones and the <do> Element
- 13. WML Template and Menu
- 14. WML Events and the <onevent> Tag
- 15. Timer and the ontimer Event
- 16. WML Event: onenterbackward
- 17. WML Event: onenterforward
- 18. WML Selection Lists and the onpick Event
- 19. WML Input Fields
- 20. WML Variables
- 21. Submitting Form Data to the Server in WML
- 22. Clearing a Saved Form in WML