Namecheap

Register a .com domain and get free Whois privacy

Lesson 2: Block Tags

What Are Block Tags?

Block tags force everything that is outside of them to be on a separate line. One such tag is the heading tag:

<h1></h1>

Example:

<body>
<h1>Learning HTML
</h1>
</body>

The number 1 beside the letter h makes the largest heading. Numbers, 2, 3 and 4 will make smaller headings. All of them make bold text. Let's see how our HTML code is shaping up:

<!DOCTYPE html>

<html>

<head>
<title>My First Webpage</title>
</head>

<body>
<h1>Learning HTML</h1> Look Ma, I'm making a webpage!
</body>

</html>

This is what it should look like on the webpage:

block tags

Notice that the text outside the h1 tag is on a separate line. This is what block tags do, they force the stuff they don't enclose to be on a separate line.

Making Paragraphs

Another block tag is the paragraph tag:

<p></p>

Any text put between the opening and closing p tags makes one paragraph. To start a new line within a paragraph add the br tag:

<p>Look Ma,<br>I'm making a webpage!</p>

The br tag is one of the few HTML tags which does not have a corresponding closing tag. The result would look like this:

Look Ma,
I'm making a webpage!

Give it a try and then head on over to lesson 3.

DID YOU KNOW...?
You can register a website address (called a domain in tech talk) even before you have a website. In fact the longer you wait the more difficult it will be to get one that isn't already taken. More Info

DID YOU KNOW...?
There is more to building a website than just making it. It also needs web hosting so that it can be seen on the internet. More Info

Easy Website Builder
Skip the tutorial and build your website or online store without learning any code Tell Me More


Disclosure

This webpage contains affiliate links which earn this site a commission should a sale result from a link that has been clicked.