11.6. WML Image Links

An anchor link can be attached to an image in WML. Creating an image link is simple. You just need to place an <img/> tag within an <anchor></anchor> tag pair or an <a></a> tag pair. The following WML example demonstrates how to create image links:


(linksEg5.wml)

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">

<wml>
  <card id="card1" title="Card 1">
    <p>
      <anchor>
        <go href="#card2"/>
        <img src="to2.gif" alt="Go to card 2"/>
      </anchor>

    </p>
  </card>

  <card id="card2" title="Card 2">
    <p>
      <a href="#card1">
        <img src="to1.gif" alt="Go to card 1"/>
      </a>

    </p>
  </card>
</wml>


This is the result of the above WML example in WAP browsers:



Sony Ericsson T610


Sony Ericsson T68i


Nokia Mobile Browser 4.0


If you select the image in the above card, the WAP browser will display Card 2, like this:



Sony Ericsson T610


Sony Ericsson T68i


Nokia Mobile Browser 4.0


Previous Page Page 22 of 50 Next Page


A button for going back to the top of this page