Name

ALIGN — NN all IE all HTML all

Synopsis

ALIGN=”where"

Optional

Determines how the IMG element is rendered in physical relation to the element’s next outermost container and surrounding content. Some settings also let you “float” the image to the left or right margin and let surrounding text wrap around the image (but no wrapping with a centered image).

Most of the rules for alignment constant values cited at the beginning of this chapter apply to the IMG element. Typically, ALIGN attributes are deprecated in HTML 4.0 in favor of the style sheet attributes. But if you require backward compatibility for your document, stick with the ALIGN attribute.

Example

<IMG SRC="surferDude.gif" ALIGN="right" HEIGHT=100 WIDTH=200>

Value

Each browser defines a different set of values for this attribute. Although the ALIGN attribute has a long heritage, not all values do. The more esoteric values, such as absmiddle and baseline, were added to browser offerings in Navigator 3 and Internet Explorer 4. Select the value(s) from the following table that work for your deployment:

Value

NN 4

IE 4

HTML 4.0

absbottom

&bull;

&bull;

-

absmiddle

&bull;

&bull;

-

baseline

&bull;

&bull;

-

bottom

&bull;

&bull;

&bull;

left

&bull;

&bull;

&bull;

middle

&bull;

&bull;

&bull;

right

&bull;

&bull;

&bull;

texttop

&bull;

&bull;

-

top

&bull;

&bull;

&bull;

Default

bottom

Object Model Reference

IE

[window.]document.imageName.align

[window.]document.images[i].align

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.