O'Reilly logo

Learning WML, and WMLScript by Martin Frost

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. WML Images

This chapter is the last one in this book dealing with WML, before we get into WMLScript. Therefore, it’s finally time to get around to the subject of images in WML.

Why have I put this topic so late in the book? Because images should not be your major concern when writing WML. Most modern web pages rely heavily on images, so most books on HTML cover images quite early. When writing WML, however, you should remember that most WAP browsers are limited in terms of their image support.

In particular, screen sizes will often be quite small. One popular WAP cell phone at the time of writing has a total size of 96 by 64 pixels, and not all of that is available to display images. Most screens are black and white. Not even all PDAs have color screens, and cell phones with color are still very rare.

Not all browsers are capable of aligning images with other items: some simply ignore all the image alignment information and put each image on a line by itself. This means you shouldn’t use images even for the bullets in a bulleted list because it would look silly if the images all appear on the line above the text they were supposed to be bulleting.

The <img> Element

Images are put into a WML page using the <img> element. If you’re familiar with HTML, you’ll recognize this tag, and it’s indeed used in a similar way. Keep in mind that some browsers lay out images inline with text, while others place images on separate lines.

Attributes of the <img> Element

src (required variable ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required