A heading is an HTML element that denotes titles and subtitles. The heading element is defined by the letter h followed by a number in the range 1 to 6. The smaller the number, the bigger the title. To add the largest available heading to your HTML page, you use <h1> some content </h1>. In the example below, the content is “My First Title”. The browser does not display the tags (<h1> and </h1>) to the user.

1. Headings and Subheadings

As previously mentioned there is 6 types of headings h1, h2, h3, h4, h5 and h6 and the smaller the number, the bigger the title. Usually, h1 is only used once as the main title of the webpage such as “About Us”, “Home” or “HTML Headings”. h2 through h6 are considered subheadings (subtitles) that are used depedning on the structure of your content. An easy way to think about it is how you would write your content in document word. Run the example below to see how these different headings appear on your browser. There is no limit to how many breakline elements you can add… however, it is important to use the right headings to show importance for search engines for good website ranking (more on that in another subject).

The code above will generate the output below on any web browser.

Rendered Headings (h1, h2, h3, h4 , h5 and h6)

2. Combining Headings & Paragraphs

Now, you can combine multiple headings and paragraphs to form your webpage as seen in the example below.

The code above will generate the output below on any web browser.

Headings & Paragraphs

4. HTML Headings Practice

Time to put yourself to test with these HTML Brealine practice exercises.

5. It’s Good to Know!

  • list of html elements
  • list of IDEs

Other Lessons in Introduction to HTML

No. Lesson Reading Time
1 Your First HTML Document 15 mins
2 HTML Paragraphs 10 mins
3 HTML Headings 10 mins
4 HTML Links 10 mins

Related Subjects

or view all subjects

Introduction to CSS

CSS (Cascading Style sheet) is used to describe how HTML elements are displayed on the screen. In other words, HTML describes the content of a web page while CSS controls its style, design and layout. Some examples of styles include color, background Read more...