This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
property of the
HTMLImageElement interface is a string which indicates
how to position the image relative to its container. You should instead use the
vertical-align, which does in fact also work on images
despite its name. You can also use the
float property to float the image
to the left or right margin.
align property reflects the HTML
htmlImageElement.align = alignMode; alignMode = htmlImageElement.align;
DOMString specifying one of the following strings which set the
alignment mode for the image.
These three values specify the alignment of the element relative to the text baseline.
These should be replaced by using the CSS
- The bottom edge of the image is to be aligned vertically with the current text baseline. Default value.
- The center of the object should be aligned vertically with the current baseline.
- The top edge of the object should be aligned vertically with the current baseline.
It may be worth noting that
vertical-align offers several additional
options for its value; you may wish to consider these when changing your code to use it.
Floating images horizontally
right properties don't affect the
baseline-relative alignment. Instead, they cause the image to "float" to the left or
right margin, allowing the following text to flow around the image. You should instead
use the CSS
float property, specifying as the value
- Floats the image over to place the left edge flush against the current margin. Any text that follows will flow against the image's right edge.
- Floats the image to place its right edge flush against the right margin. Subsequent text will flow along the image's left edge.
|HTML Standard (HTML)|
BCD tables only load in the browser