Close this window

Using the <image> tag

Description

The image tag is used to place image files, such as JPG, GIF, and PNG, into modules. Any image file with a valid MIME type can be included on the page.

Example

This CNXML:


<media id="greyhound" 
       alt="A greyhound relaxing on a bed.">
  <image mime-type="image/jpeg" 
         src="image1.jpg" />
</media>
        

Results in this display:

A greyhound relaxing on a bed.

Example

This CNXML:


<media id="greyhound" 
       alt="A greyhound relaxing on a bed.">
  <image mime-type="image/jpeg" 
         src="image1.jpg" />
  <image mime-type="application/postscript" 
         src="image1.eps" 
         for="pdf"/>
</media>
        

Results in this display:

A greyhound relaxing on a bed.

This example demonstrates the use of the for attribute to specify an alternate image for the PDF version of the module. The Web-ready JPEG image, here used as the default option, will be displayed when viewing the module online and the second image, a higher-resolution EPS file, will be used for the PDF version.

Attributes(what's this?)

Children(what's this?)

param, term, cite, cite-title, foreign, emphasis, sub, sup, code, preformat, quote, note, list, audio, flash, video, java-applet, image, labview, download, Unicode text

Parents(what's this?)

media, audio, flash, video, java-applet, image, labview, download
Close this window