HTML h1 - h6 align property
Examples
Align the HTML title:
<h1 align="center">这是标题 1</h1>
<h2 align="left">这是标题 2</h2>
<h3 align="right">这是标题 3</h3>
<h4 align="justify">这是标题 4</h4>
<h2 align="left">这是标题 2</h2>
<h3 align="right">这是标题 3</h3>
<h4 align="justify">这是标题 4</h4>
try it"
Browser Support
All major browsers support align attribute.
Definition and Usage
HTML5 does not support the <h1> - <h6> align attribute. Use CSS instead.
In HTML 4.01, <h1> - <h6> The align attribute is deprecated .
align attribute specifies the horizontal alignment of the title.
Compatibility Notes
<H1> - <h6> The align attribute is deprecated. Use CSS instead.
CSS Syntax: <h1 style = "text-align: right">
CSS Example: set the title alignment
In our CSS tutorial you can find more information about the text-align attribute details.
grammar
<h1 align="left|right|center|justify">
Property Value
值 | 描述 |
---|---|
left | 左对齐标题(默认值)。 |
right | 右对齐标题。 |
center | 居中对齐标题。 |
justify | 标题有合理的边距。 |
HTML <h1-h6> tags