Paragraphs and headings

We’re definitely making good progress! We’ve learned when and why we use HTML. We’ve also learned how to:

a. Set up an HTML file with tags
b. Title the webpage (in the <head>)
c. Create paragraphs (in the <body> with <p> tags)

The next step is to give our paragraphs headings using heading tags. Let’s start with the <h1> tag. The content between this tag will be the biggest!

Do it Yourself

  1. Create a new html file with Notepad++ and name it as test.html.
  2. Copy the code lines below and paste them to your new test.html file:
  3. [html]
    <!DOCTYPE html>
    <html>

    <head>
    <title>
    Headings & Paragraphs
    </title>

    </head>
    <body>

    </body>
    </html>
    [/html]

  4. Now in the body section, create a heading. To do this, create an <h1> tag.
  5. Add content.
  6. Close the element with a closing tag </h1>. (Your content should now be between <h1> and </h1>.)
  7. Underneath the heading tags, create two paragraphs using <p> tags with whatever content you like.
  8. Finally save the file and run it with your preferred browser.

Your final code should look like the following:

[html]
<!DOCTYPE html>
<html>
<head>
<title>
Headings & Paragraphs
</title>
</head>
<body>
<h1>Put your headings here</h1>
<p>Your first paragraph after heading</p>
<p>Your second paragraph</p>
</body>
</html>
[/html]
 
We have total six sizes of headings in HTML h1, h2, h3, h4, h5, h6 where h1 is the largest and h6 is the smallest heading. Now that you know how to create a HTML page and put a paragraph along with a heading inside the body tags.

You are all done for today!

Leave a Comment