h1 tag (XHTML 1.0)
headingThe hX tags are used to create headers on a page. H1 should be used for the most important header, while H6 should be used for the least important header. Browsers will render them in different sizes, based on their number, with H1 being rendered in the largest font and H6 in the smallest font.
Some people tend to not use the header tags, or use them in a wrong way, because they do not care for the way the tags are being rendered in their favorite browser, but that's wrong. You should always use the header text, mainly because a lot of search bots, especially Google's, use the information to figure out what your pages are all about. They prioritize text in header tags before the overall content of the page, so it's your best chance to emphasize what you think your page is all about.
The tags are as simple as it gets to use:
<h1>Header 1</h1>
If you don't like the specific look of one of the header tags, the solution is simple: Style it with CSS, using the font-family, the font-size and perhaps even the color property.
The align attribute
The align attribute allows you to specify to which direction text should be aligned. For instance, align="right" would align the text to the right side. However, the align attribute has been deprecated, and instead, you should use the CSS text-align property. For instance, like this:
<h1 style="text-align: right;">Right aligned text</h1>
Attributes
| Attribute | Deprecated | Required | Description |
|---|---|---|---|
| align | X | align, text alignment | |
| class | space-separated list of classes | ||
| dir | direction for weak/neutral text | ||
| id | document-wide unique id | ||
| lang | language code | ||
| style | associated style info | ||
| title | advisory title |
Events
| Event | Description |
|---|---|
| onclick | a pointer button was clicked |
| ondblclick | a pointer button was double clicked |
| onkeydown | a key was pressed down |
| onkeypress | a key was pressed and released |
| onkeyup | a key was released |
| onmousedown | a pointer button was pressed down |
| onmousemove | a pointer was moved within |
| onmouseout | a pointer was moved away |
| onmouseover | a pointer was moved onto |
| onmouseup | a pointer button was released |