Latest web development tutorials

HTML div align property

HTML div tag Reference Manual HTML <div> tag

Examples

Document a part of the center alignment:

<div align="center">
这是一些文本!
</div>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support align attribute.


Definition and Usage

HTML5 no longer supported <div> align property, use CSS instead.

<Div> The align attribute in HTML 4.01 have been abandoned. in HTML 4.01.

align attribute specifies the <div> element contents of the horizontal alignment.


Compatibility Notes

HTML5 no longer supported <div> align property, use CSS instead.

CSS Syntax: <div style = "text-align: center">

CSS Example: to narrow the list row height

In our CSS tutorial you can find more information about the text-align attribute details.


grammar

<div align="left|right|center|justify">

Property Value

value description
left Left-aligned content.
right Right-aligned content.
center Align content.
justify Extending rows so that each row can have equal length (as in newspapers and magazines).


HTML div tag Reference Manual HTML <div> tag