align attribute is used to specify how the image
sits on the page in relation to surrounding text and other elements. It is
a fairly rudimentary attribute—and a very presentational one—that allows
you to move an image to the right or left, with text wrapping around it
accordingly (although without surrounding whitespace, which generally
produces quite an ugly result). You can also alter the adjacent text
alignment so that the first line of the text aligns with the top, middle,
or bottom of the image.
The example markup shown with a right-aligned image would appear as shown in Figure 1.
If the value were changed to
the effect would be very different, as Figure 2 shows.
alignis set to
As the two examples show, the
align attribute is no precision instrument when it
comes to layout!
img is aligned
"right", text will
continue to wrap around it until it encounters either:
align attribute for this
<p><img src="giant-prawn.jpg" alt="The Giant Prawn at Ballina" align="right"/>Driving along, we spotted a giant prawn, so had to stop and take a closer look.</p>
"top" are the values
that this attribute may take.
Nonstandard, proprietary attributes
(which are still supported by Internet Explorer) that are acceptable
This attribute is now deprecated, and is highly presentational in its nature. The desired visual effects can all be achieved with CSS and, as such, this attribute shouldn’t be used—it’s presented here for informational purposes only.