Chapter 7. WML Text and Text Formatting

By this point, you have seen how to create all sorts of interactive applications in WML and how to use variables, tasks, and events to do things that would require serious server-side processing in HTML.

Now that there aren’t any exciting new features to cover, it’s time to go back to simple text and see what can be done with it to make it more interesting. This is an area where WML is seriously lacking in comparison to HTML, which provides all sorts of features for changing the size, style, typeface, and color of text, as well as powerful support for tables.

One reason for not covering this topic earlier is that it shouldn’t be your major concern when creating WML. Most cell phone browsers simply ignore all these text-formatting options, so a large number of users never see all the styles you spend so long choosing. Text style changes can be used to make your WAP content look much more attractive on PDAs and future smart cell phones, but you should not think of them as more than just little decorations to be added on once everything is working properly. Even features such as tables and centered or right-aligned text are not guaranteed to be present in all browsers. Having said that, the first element we look at is one that’s always present in some form—the <p> element.

The <p> Element

As you saw back in Example 1.1, the <p> element marks a paragraph of text in a WML card. All body text, user controls (such as <input> and <select> elements), ...

Get Learning WML, and WMLScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.