Using image in WML We can use the

Using image in WML We can use the Tutorial Using image in WML In this lesson we will write application that images. We can use the tag to display the image in our document. The image appears wherever tag is placed within the text.

Using image in WML We can use the

Using image in WML

In this lesson we will write application that images. We can use the <img> tag to display the image in our document. The image appears wherever <img> tag is placed within the text. Some cellular does not support image, in that case we can use the alt property of <img> to display the text.

 
 
Syntax:

<img alt="text" src="url" localsrc="icon"/>

Attribute Functionality
alt Text to be displayed when cellular device does not support image or the image was not available.
src URL of the image.
localsrc The name of a known icon.

  

Now here is the code of the program.

<?xml version="1.0"?>

<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"

"http://www.wapforum.org/DTD/wml_1.1.xml">

<wml> 
<card id="C1" title="Learning WML!">
  <p mode="nowrap">
   Select:<br/>
   <a href="#jokes">Jokes</a><br/>
   <a href="#star">Star</a><br/>
   <a href="#target">Target</a><br/>
  </p>
</card>
<card id="jokes" title="Learning WML">
<do type="accept">
<prev/>
</do>
<p>Jokes:
<img localsrc="hound" alt="prev" src="joke.gif"/>
</p> 

</card>
<card id="star" title="Learning WML">
<do type="accept">
<prev/>
</do>
<p>Star:
<img localsrc="star2" alt="prev" src="star.gif"/>
</p> 
</card>
<card id="target" title="Learning WML">
<do type="accept">
<prev/>
</do>
<p>Target:
<img localsrc="circleslash" alt="prev" src="target.gif"/>
</p> 
</card>
</wml> 

First of all copy the above code in the following text box and then press test button to test it.


Now try to create me application using the images. 
  

 
  

Tutorial