Lesson 2

Making things a bit more interesting.

How about giving your file a title?

Make yourself a new file, and this time, type:

<html>
<head>
<title>Banana</title>
</head>
<body>
This file is about bananas. You're doing great!
</body>
</html>

Key: "head" is a "hidden" bit of the page, the bit where you can sneak instructions to the computer that won't show up on the page. In this case, you tell the computer that this document is called "Banana", and this will appear in the bar at the top of the browser when you load the file.

Save this as second.html (or banana.html if you like)

Load in your browser and admire how your page now has a title!

Now, if you just add more text to the page, the way you would in Word, you'd find when you loaded the file in your browser that it's one continuous block! So how do you add breaks?

This is
If you simply want to start a new line, you use the tag <br>; this is equivalent to hitting the Enter key in Word.
If you want to start a new paragraph, you can do a couple of things:
The "super-easy" way is simply to use two <br> tags.
A better way is to start each paragraph with <p>; a <p> tag is equivalent to hitting Enter "one and a half" times; it leaves a slightly smaller gap between paragraphs that may look neater.
The "proper" way to do it is to start each paragraph with <p> and end it with </p>.

If you don't know what a paragraph is, you're probably not intelligent enough to be allowed to code webpages.

So, take your second.html file and alter it so it says this:

<html>
<head>
<title>Banana</title>
</head>
<body>
This file is about bananas. You're doing great!<br>
A break tag is like hitting enter once.<br><br>
<p>A paragraph tag is like hitting enter one and a half times.
<p>Best of all is to package all your paragraphs up neatly.</p>
</body>
</html>

Save it, and see how it looks!

 

On to lesson 3...