Mobile Internet: WML/WAP Tutorial
Part 3 - Adding Text
In the last part I showed you how to create the basic file which will contain your WAP site. In this part I am going to show you how to insert text and how to format it.
The <p> Tag
Just like in HTML the <p> tag is used to show where a paragraph begins and ends. Unlike HTML, though, all text on a WML page must be inside these tags. You are not allowed to nest these tags either. One important thing to remember about WML is that, unlike HTML where a page will still display even if there is bad code, a WAP phone will just reject a page if there is and code it doesn't understand.
As with HTML you use the tags as follows:
Aligning text in WML is nearly exactly the same as in HTML, except you can't use the center tag. All aligning must be done using the following <p> tags:
The <br/> Tag
In WML (as mentioned earlier) all tags must be closed. This causes problems when using old HTML tags (like <Br>) which have no closing tag. To get around this, some tags have had a / put on the end e.g.
This, like in HTML will make a line break.
In WML there is actually no font tag (as you can only display text in the phone's default font in black). To show text all you need to do is put it in between the <p> and </p> tags. Here is an example of a full WML document:
<?xml version="1.0"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<card id="index" title="My WAP Site" newcontext="true">
Welcome to my new WAP site. You can view this on your mobile phone anywhere in the world!<Br />
It is amazing!
In Part 4 I will show you how to add hyperlinks and images to your site.
1999 - 2001 David Gowans