HTML Headings

Headings are used to add titles to sections of page. HTML defines six levels of headings. The number indicate heading levels (h1 through h6). The headings, when they are displayed aren't numbered. They are displayed in larger and bolder text so that they stand out from regular text.


Headings can be any length, spanning many lines of text because headings are emphasized, however, having many lines of emphasized text might be tiring to read.

Headings

  • Six level of heading tag, <h1> through <h6>
  • Higher level number greater importance
  • Larger and border font

Example

<h1> This is first-level Heading </h1>
<h2> This is second-level Heading </h2>
<h3> This is third-level Heading </h3>
<h4> This is fourth-level Heading </h4>
<h5> This is fifth-level Heading <h5>
<h6> This is sixth-level Heading </h6>

Heading Attribute

👉Heading Tag Attribute:

1. Align 

  • Left
  • Right
  • Center
  • Justify

2. Title (Display a text message when curser come over headings)

Example

<!DOCTYPE html>
<html>
<head>
<title> HTML Headings </title>
</head>
<body>
<h1 align = center title = "Hyper Text Markup Language"> HTML </h1>
</body>
</html>

NOTES.....

1. Don't use headings to display text in boldface type or to make certain parts of your page stand out more. Although the result might look as you intend, the markup will not represent the structure of your page.

2. From a visual perspective, headings 4 through 6 aren't visually interesting, but they do have meaning in terms of the document's structure. If using more than three levels of heading make sense for the document you are creating. 

Previous Post Next Post