02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoNext Video

Creating Headlines: Tags H1 Through H6

In this video, we dive into HTML headline tags (<h1> to <h6>), used to organize content on a webpage. Learn how to create meaningful, structured titles that help both users and search engines understand your content. From the main headline (<h1>) to subheadings (<h2> to <h6>), discover best practices for using these tags effectively.

Video Transcript

00:00We stepped along in our progress so far
00:03and we've created already quite a lot of tags
00:06First I want to see if you have any questions so far?
00:09- no
00:10-we're good?
00:11-I think I'm okay, yeah
00:12-very very cool
00:13-I know a good title! What to buy mom for Mother's Day!
00:16-Let's do that, let's create a new title
00:18So let's go into our body and let's learn
00:20a new inner title inside of our page
00:25We're gonna learn six new tags right away
00:29There is a lot of different types of titles,
00:31you could see that also in books, there is like
00:33the highest importance title - like a chapter name
00:36then there's in-the-page titles
00:38and HTML provides you the flexibility of creating titles
00:42up to six levels deep
00:44You could have the most important title,
00:46a little bit less important, and less important...
00:48just to break down the page and make it more easy
00:50for people to read.
00:52The way you create titles in HTML is very simple.
00:55inside of your body, because we want to create a title
00:57in the body
00:58we're going to create an 'h1' tag
01:00now, the h1 tag is the highest priority tag
01:03and it could go all the way down to h6
01:05If you don't need h6, don't use h6,
01:07just do h1, h2, h3 if you ever need to.
01:10It's really rare when page will need all the way to go down from h1 to h6
01:14but it's used for headlines only
01:16We're going to call this: What to buy mom for Mother's Day
01:29It's good to have my spell-check with me while we're doing this.
01:33so 'what to buy mom for Mother's day'
01:36and we probably want to write something inside
01:38but I'm going to delete this copy for now
01:40and by the way, this copy was a floater,
01:42it was inside of our body but we didn't really describe
01:45what it is
01:46-okay.
01:47note a good idea, we always wanted describe what a copy is
01:50so the search engines could understand what it is
01:54in this case this is probably a part of a paragraph
01:57or this may be a slogan we want to put
01:59so it may be 02geek is a great school,
02:01we may want to put as h3 title on the bottom of the page
02:04to remind you that 02geek is a great school

Ready to Level Up Your Skills?

Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!

Enroll Now for Free!

Lesson notes

In this tutorial, we’ll explore HTML headline tags, ranging from <h1> to <h6>. These tags help structure your webpage content, improving readability for users and discoverability for search engines.


1. What Are HTML Headline Tags?

Headline tags define the importance of titles on a webpage, with <h1> being the most important and <h6> the least.

  • <h1>: Typically used for the main title or headline of the page.
  • <h2> to <h6>: Used for subheadings to break down content into smaller sections.

Example:

<h1>What to Buy Mom for Mother's Day</h1>
<h2>Top Gift Ideas</h2>
<h3>Personalized Gifts</h3>

2. Why Use Headline Tags?

  1. Improve Readability:

    • Headline tags make it easier for users to scan and understand content.
    • Similar to book chapters and subheadings, these tags guide readers.
  2. Enhance SEO:

    • Search engines use headlines to understand the structure of your content.
    • Meaningful, descriptive headlines improve your page's search ranking.
  3. Content Hierarchy:

    • Headlines help organize content visually and semantically.
    • Use them to indicate relationships between sections (e.g., <h2> for subsections of <h1>).

3. How to Use Headline Tags

Follow these steps to add headlines to your HTML page:

  1. Open Your HTML File:

    • Use any plain text editor, such as Sublime Text or Notepad.
  2. Add a Headline to the BODY Section:
    Type the following code inside the <body> tag:

    <h1>What to Buy Mom for Mother's Day</h1>
    <h2>Top Gift Ideas</h2>
    <h3>Personalized Gifts</h3>
    <h4>Handmade Jewelry</h4>
    <h5>Gift Cards</h5>
    <h6>Budget-Friendly Options</h6>
    
  3. Save and View in a Browser:

    • Save the file as headlines.html.
    • Open it in your browser to see the headlines displayed with different font sizes.

4. Best Practices for Headline Tags

  1. Start with <h1>:

    • Every page should have one <h1> tag.
    • Use it for the main title of the page.
  2. Use Subheadings as Needed:

    • Use <h2> to <h6> for organizing content under <h1>.
  3. Avoid Skipping Levels:

    • Maintain a logical hierarchy. For example, don’t jump from <h1> to <h4>.
  4. Use Descriptive Text:

    • Make headlines meaningful and relevant to the content they introduce.

5. Example Page with Headlines

Here’s a complete HTML page using headline tags:

<html>
  <head>
    <title>What to Buy Mom for Mother's Day</title>
  </head>
  <body>
    <h1>What to Buy Mom for Mother's Day</h1>
    <h2>Top Gift Ideas</h2>
    <h3>Personalized Gifts</h3>
    <p>Consider custom photo frames, engraved jewelry, or monogrammed items.</p>
    <h3>Handmade Jewelry</h3>
    <p>Explore unique and heartfelt gifts from local artisans.</p>
    <h4>Affordable Options</h4>
    <p>Even on a budget, you can find thoughtful gifts that make an impact.</p>
  </body>
</html>

Summary

By the end of this tutorial, you’ve learned:

  1. How to use headline tags (<h1> to <h6>) to structure your content.
  2. Why headlines are important for readability and SEO.
  3. Best practices for using headline tags effectively.

What’s Next?

In the next lesson, we’ll look at how to create and style paragraphs to complement your headlines.

Learn more at HTML Training with Mom.