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.
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.
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