XHTML
MP Images

Displaying an Image
in XHTML MP

The
<img> tag is used to display an image in XHTML MP. This is the
same as in HTML. WAP browsers will display the text assigned to the
alt attribute of the <img> tag if it cannot display the
image for reasons such as file not found or image format not
supported. The height and width attributes of the <img>
tag, as their names suggested, are used to specify the height and
width (in pixels) of an image's display area. You can make use of
these two attributes to scale up or down the size of an image on the
screen.

Besides
the old WBMP image format, WAP 2.0 wireless devices should be able to
support image formats commonly used on the web such as GIF, animated
GIF, JPG, and PNG. However, this is device-specific. Some WAP 2.0
wireless devices can only support a subset of the above image
formats.

One
simple way to find out whether a particular image format is supported
on a wireless device is to check the accept HTTP header, like what we
have done in the "Choosing MIME Types Dynamically"
section of this XHTML MP tutorial. For example, if "image/gif",
"image/jpg" and "image/png" are found in the
accept HTTP header, it means the wireless device supports the GIF,
JPG and PNG image formats.

The
following example demonstrates how to display an image in XHTML MP:

What do you think about this web page? It is very helpful. It is helpful, but some information I wanted is missing. It is not helpful. It has broken links. It has typos / grammatical mistakes. It has incorrect information. Others

(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Due to the amount of messages we received, we may not be able to reply to all messages.