HTML heading tags

What Are Section Headings in HTML and How Are They Used?

In HTML there are six levels of Section heading available from 1 through 6. Text present in heading tags displayed in larger and bolder fonts as compare to normal text on the web browser. These six heading categories display text in different sizes. The examples of all the heading categories are mentioned below: Examples


<html>
    <head></head>
    <body>
        <h1>Heading1</h1>
        <h2>Heading2</h2>
        <h3>Heading3</h3>
        <h4>Heading4</h4>
        <h5>Heading5</h5>
        <h6>Heading6</h6>
    </body>
</html>
Output

Heading1

Heading2

Heading3

Heading4

Heading5
Heading6

FAQ 1. Can I use CSS to change the color of HTML headings? Yes, you can change heading colors using the CSS color property. You can also customize fonts, backgrounds, borders, spacing, and alignment. 2. What is the default alignment of HTML headings? HTML headings are generally left-aligned by default in left-to-right documents. You can change their alignment using the CSS text-align property. 3. Are HTML heading tags supported on mobile devices? Yes, all six HTML heading tags work on mobile devices. You can use responsive CSS to adjust heading sizes and spacing for different screen widths.