Share via


IMG XHTML Element (Windows Embedded CE 6.0)

1/6/2010

The IMG element embeds an image in the document. This is also the DOM object IMAGE.

Using this Element

There are some common properties and collections that apply to all the elements of the document object model, see Common Properties, Methods and Collections for the HTML Elements in Internet Explorer.

This element can be used within a web page with attributes.

This element can be used within scripts where it will have properties, events and methods.

Attributes

The following table shows items that Internet Explorer Embedded supports.

Attribute Value Description

ALIGN

 

Specifies the alignment of text following the IMG reference relative to the graphic on screen.

 

absbottom

This attribute is equivalent to the CSS:

vertical-align: text-bottom;

 

absmiddle

This attribute is equivalent to the CSS:

vertical-align: middle;

 

baseline

This attribute is equivalent to the CSS:

vertical-align: baseline;

 

bottom

This attribute is equivalent to the CSS:

vertical-align: bottom;

 

left

This attribute is equivalent to the CSS:

vertical-align: left;

 

middle

This attribute is equivalent to the CSS:

vertical-align: middle;

 

right

This attribute is equivalent to the CSS:

vertical-align: right;

 

texttop

This attribute is equivalent to the CSS:

vertical-align: text-top;

 

top

This attribute is equivalent to the CSS:

vertical-align: top;

ALT

String

Specifies a text alternative to the graphic

BORDER

0…#

This controls the thickness of the border around the image (in pixels) whether as a hyperlink or as a stand-alone image.

This attribute is equivalent to the CSS:

border: {n} solid;

CLASS

 

Associates the element with a CSS style.

HEIGHT

0…#

Specifies the height of the image in pixels or as a percentage of the parent object.

This attribute is equivalent to the CSS:

height: {n};

HSPACE

0…#

Sets the horizontal margin for the image in pixels.

This attribute is equivalent to the CSS:

margin-left: {n}; margin-right: {n};

ID

 

Uniquely identifies the element within a document.

ISMAP

 

Specifies that the image is a server side image map

NAME

 

 

ONLOAD

 

 

SRC

URL

Specifies the URL of the image to be displayed. The browser supports .JPEG, .JPG, .GIF, .PNG, .XBM, and .2BP files.

STYLE

 

Provides the definition of the CSS styles used for this element.

USEMAP

URL

Specifies the URL of the client-side image map. For example, a bookmark like #map.

VSPACE

0…#

Sets the vertical margin for the image in pixels.

This attribute is equivalent to the CSS:

margin-top: {n}; margin-bottom: {n};

WIDTH

0…#

Specifies the width of the image in pixels or as a percentage of the parent object.

This attribute is equivalent to the CSS:

width: {n};

Scripting Properties

The following table shows items that Internet Explorer Embedded supports.

Property Type Access Comments

alt

string

Read

Sets or retrieves a text alternative to the graphic.

border

variant

Read

Sets or retrieves the width of the border to draw around the object.

height

long

Read/Write

Sets or retrieves the height of the object.

hspace

long

Read

Sets or retrieves the horizontal margin for the object.

onload

function

Read/Write

 

src

string

Read/Write

Sets or retrieves a URL to be loaded by the object.

vspace

long

Read

Sets or retrieves the vertical margin for the object.

width

long

Read/Write

Sets or retrieves the calculated width of the object.

Scripting Events

The following table shows items that Internet Explorer Embedded supports.

Event Comment

onload

 

Scripting Methods

This property has no associated methods.

Requirements

Windows Embedded CE Windows Embedded CE 6.0 R3

See Also

Concepts

Internet Explorer Embedded HTML Elements