18.4. XHTML MP Image Links

An anchor link can be attached to an image in XHTML MP. Just place an <img> tag within the <a></a> tag pair. This XHTML MP example shows how to do this:


(linksEg4.xhtml)

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>XHTML MP Tutorial</title>
  </head>

  <body>
    <p>
      This is page 1.<br/>
      <a href="linksEg5.xhtml"><img src="to2.gif" alt="Go to linksEg5.xhtml"/></a>
    </p>
  </body>
</html>


(linksEg5.xhtml)

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>XHTML MP Tutorial</title>
  </head>

  <body>
    <p>
      This is page 2.<br/>
      <a href="linksEg4.xhtml"><img src="to1.gif" alt="Go to linksEg4.xhtml"/></a>
    </p>
  </body>
</html>


These are the screenshots of the linksEg4.xhtml page in WAP browsers:


Sony Ericsson T610


Nokia Mobile Browser 4.0


If you select the image, the WAP browser will display the XHTML MP file linksEg5.xhtml.


Sony Ericsson T610


Nokia Mobile Browser 4.0


Previous Page Page 26 of 36 Next Page


Feedback Form (ExpandCollapse)

What do you think about this web page?






(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:

Please enter again to confirm:

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

A button for going back to the top of this page