HTML - Headings

Headings:

  • In general, Headings are the title or subtitle given for the content on the web page.
  • Headings in HTML are defined by using a tag <hn> where 'n' refers to the level number 1 to 6.
  • <h1> is used for the most important heading whereas <h6> is used for the least important heading.

        
     <h1>Heading 1</h1>
     <h2>Heading 2</h2>
     <h3>Heading 3</h3>
     <h4>Heading 4</h4>
     <h5>Heading 5</h5>
     <h6>Heading 6</h6>

  • Headings are used to making the contents more SEO friendly Since search engine uses the heading to index the structure and content of the web page.
  • For these heading elements, Browser will automatically add a white space before and after the heading in the HTML document.
  • Don't use the Heading element to highlight any word or sentence in a paragraph. for this purpose, we have a different element like strong.
  • Headings can use the "align" attribute to align the heading left, center, or right.


<!DOCTYPE html>
<html lang="en">
    <head>
        <title>HTML5 Course Example</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
    </head>
    <body>
        <h1 align="center">Heading 1</h1>
        <h2>Heading 2</h2>
        <h3>Heading 3</h3>
        <h4>Heading 4</h4>
        <h5>Heading 5</h5>
        <h6>Heading 6</h6>
    </body>
</html>


No comments:

Post a Comment