<< Chapter < Page | Chapter >> Page > |
media
element, use the
for
attribute to specify when that object should be displayed.Within each
<media>
element, at least one media subtype is required. The following sections describe how to create the various possible subtype elements.
Some of the image file types and their corresponding MIME types used in Connexions modules are:
To embed images in your module, insert CNXML entries similar to the
following example into the "index.cnxml" file for your module:
<figure id="figure-01"><title>Example Figure</title><media id="figureexample" alt="an envelope with a blue page"><image mime-type="image/png" src="Xenveope-blue-on-blue.png"/></media><caption>A graphic image displayed as a figure.</caption></figure>
The
src
attribute in the image tag gives the location
or source of the image that you want to appear in the module. Afterloading the image file into the 'Files' tab on your module, simply
provide the full file name (e.g. "
envelope-taller.png
") to specify
which image should be used.
The actual display for the previous CNXML example is:
You can use optional size attributes to control the size of the image displayed in both online and print versions of the content. There are a few things to keep in mind when specifying image sizes in CNXML:
You can adjust the size of the image in the on-line version of your document by using the
height
and
width
attributes.
The following code will display the image in its original, default size:
<figure id="element-439"><media id="tajmahal" alt="The Taj Mahal"><image src="TajMahal_medium.jpg" mime-type="image/jpeg"/></media><caption>The photograph of the Taj Mahal in this figure and the following figureswas taken by<link url="http://www.flickr.com/photos/babasteve/">Steve
Evans</link>. It is licensed for public use under the Creative Commons
Attribution License.</caption></figure>
Notification Switch
Would you like to follow the 'Ideas and tools for improving connexions modules and collections' conversation and receive update notifications?