Computer Nerd

Learn HTML Part 1.2: Headings


Last time we learned:

We left off with the following page:

<!DOCTYPE html>
    <meta charset="utf-8">
      Hello, world!

Trying headings

A heading is a bit of text that tells the viewer what section this is. For example, the heading just above@

In HTML, there are six types of headings: <h1>, <h2>, <h3>, <h4>...

Load the file from the previous lession. Let's make our "Hello, world" a heading.

  Hello, world!

Save the file and open it in your web browser. You should now see "Hello, world" in big text.

Let's try a smaller heading. Below your "Hello, world" message, add:

  And this is a sub-heading!

You should now have "Hello world" in large text and "And this is a subheading" in slightly smaller text.

It's about time I showcased a common mistake. Try adding this to the Hello World!

  Hello World!
    Oi, spaceman!

You'll notice that "Oi, spaceman!" is also a heading. Remember to end with </h1> every time.

Learn HTML is continued here.