HTML <object> alignAttribute

HTML object 标签参考手册HTML <object> Tag

Examples

A right-aligned <object>:

<object width="200" height="200" data="helloworld.swf" align="right"></object>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the align attribute.


Definition and Usage

HTML5 does not support the <object> align attribute. Please use CSS instead.

In HTML 4.01, the align attribute of <object>is deprecated。

The align attribute specifies the alignment of the <object> element relative to surrounding elements.

The <object> element is an inline element (it does not insert a new line on the page), which means text and other elements can wrap around it. Therefore, it is useful when specifying the alignment of <object> relative to surrounding elements.


Compatibility Notes

In HTML 4.01, the align attribute of <object> is deprecated. Please use CSS instead.

CSS syntax: <object style="float:right">

CSS Example: Float an <object> to the right

In our CSS tutorial, you will see more aboutthe float propertydetails.


Syntax

<object align="left|right|middle|top|bottom">

Attribute Values

Value Description
left Aligns the object to the left.
right Aligns the object to the right.
middle Aligns the object to the center.
top Aligns the object to the top.
bottom Aligns the object to the bottom.


HTML object 标签参考手册HTML <object> Tag Other Extensions