1 min read

Headings

In HTML Basics, you created an h1 element. h1 is one of six heading levels available in HTML. Headings are used to establish hierarchy within your web content.

So, h1 is the equivalent of the title of the current page and each of the following levels falls below that, much like a table of contents.

See the Pen HTML Headings by Angelique (@angeliquejw) on CodePen.

In the example above, you can see all six heading levels and, on the right, their default formatting in your web browser.

It’s important to note at this point that when you get into learning CSS, you’ll be able to make headings and any other HTML elements look the way you want in terms of spacing, font size, color, etc. While browsers apply default styles to HTML documents like what you see here, this should not limit you and should not change how you write your HTML.

CSS is used to adapt what a web page looks like; HTML is used to provide structure and meaning to your web content.

To be more clear: Just because you want text in your HTML document to be large does not mean you should use an h1 element. You should use an h1 element because the content it wraps is the title or subject of the web content.

Make this page better.

Found something that's incorrect or confusing on this page? Broken link? I want to know! Open an issue on GitHub to tell me what's up and help me update the page.