Lesson 5: Changing the look of text with text formatting elements
This lesson introduces the tags used to change the style and layout of text. It should be noted that the style tags are supported to different degrees by different types of microbrowser.
With each of the following pairs of tags, the text is affected by placing it within the tags. It does not seem possible to apply more than one text style to a single piece of text.
|
<b></b>
|
- makes the text bold
|
|
<big></big>
|
- makes the text big
|
|
<em></em>
|
- emphasises the text (as the browser chooses)
|
|
<i></i>
|
- italicises the text
|
|
<small></small>
|
- makes the text small
|
|
<strong></strong>
|
- strong emphasis (the effect is open to the browser)
|
|
<u></u>
|
- underlines the text
|
The <br/> tag is one of the tags that doesn't come in a pair. It forces a line-break. The following code shows the use of a number of the tags above, as well as the <br/> tag:
|
1.
|
<?xml version="1.0"?>
|
|
2.
|
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
|
|
3.
|
<wml>
|
|
4.
|
<card id="card1" title="Welcome">
|
|
5.
|
<p>
|
|
6.
|
Text Formating Examples:<br/>
|
|
7.
|
<big>Big Text</big><br/>
|
|
8.
|
<em>Emphasised Text</em><br/>
|
|
9.
|
<strong>Strong Text</strong><br/>
|
|
10.
|
<b>Bold Text</b><br/>
|
|
11.
|
</p>
|
|
12.
|
</card>
|
|
13.
|
</wml>
|
|
|
The following pictures demonstrate how this script is displayed in the phone.com emulator and the Nokia blueprint WAP 1.2 phone emulator:

phone.com
|

Nokia
| 
Nokia
|
|