Let's talk about the form for a basic web page. We will discuss 4 tags. That's a lot of info, but they are all easy and we need all of them to make a page. We'll discuss them in depth later. Normally we will discuss one tag at a time.
For clarity in this series, I will use a new line for every tag, new content or closing tag. I recommend using this practise on your pages for easy editing.
Tags For This Lesson
HTML: <html>...</html>
HEAD: <head>...</head>
TITLE: <title>...</title>
BODY: <body>...</body>
New Concept: Container Tags
All of this lesson's tags are containers. That means they have an opening part and a closing part and there is something in between - they
"contain" something.
All containers have the form:
<tag>...</tag>
I will use 3 dots (...) in this series to indicate some sort of content.
TIP
You may want to make a "template" page or 2 that you can copy and paste
whenever you want to start a new page. Then just fill in what you want
for your new page.
RULE
All tags should be written in lower case.
Let's get started.
The first thing we need to do when writing a web page is to let the
world know that it is a web page and not something else. Web pages are
HTML (Hyper Text Markup Language) documents. We use the <html> tag to start every page and </html> to close every page.
Rule: There should be only one <html...</html> set per page.
<html>
...
</html>
TIP
A common mistake is to forget to close container tags. When you open a
tag, close it right away, then fill in the content in between.
Every web page should contain 2 sections, a head and a body.
The head contains information about the web page. Open it with
<head>, put in your info, then close it with </head>.
Rule: The head always comes before the body. There is only one head section per page.
<html>
<head>
...
</head>
...
</html>
The first thing we want the world to know about our page is the
title. It goes inside the head. Open the title with <title>, enter the name of
your page, then close the title with </title>.
Rule: Only one title per page. It goes in the head section.
<html>
<head>
<title>
Put your title here
</title>
</head>
...
</html>
The body contains your page content. It may have text, images, links, etc. This is the part of your page that people will actually "see".
Open the body with <body>, enter page content, then close the body with </body>.
Rule: There is only one body section per page.
<html>
<head>
<title>
Put your title here
</title>
</head>
<body>
Page content
</body>
</html>
We now have all the elements of a basic web page in place in the proper order. We have learned some rules and some tips.
For email sigs, you don't need the head section.
To make our page readable for all browsers, we need to add a DTD and some other code. Then we'll be all set to go.
Happy coding!
Gnubee