To tell the browser how to display our HTML page, we use tags to create more containers. Just like our HTML, HEAD, and BODY containers, the tags we put in our page say "everything between the opening tag <TAG> and the closing tag </TAG> is in a container that should be displayed as the tag describes."
By the way, there is not an HTML tag called <TAG> itself; we're just using this as a generic description to show how tags should be used.

Here, we've used the <b> tag to create a bold container, and this is how it will be displayed:
This is a bold container.
Using tags is easy. As Miyagi-san taught in Karate Kid, it's just "wax on, wax off." That is, open your container with the tag you want in angle brackets <TAG>, and then close it when you're done by repeating the tag with a backslash added </TAG>.

Containers can be nested like Chinese boxes, and their combination can give you lots of cool effects. Here is how this set of tags will be displayed:
Containers can be nested.

But remember to close your tags in the reverse order that you opened them (or "go home with the tag that brought you"). If you don't, you could get unexpected results. Even if it looks like you want on your browser, people on other browsers may not be able to see your page the way you intended.
Some tags can be extended with attributes to do lots of neat things. Attributes are descriptions that are added to the tag opening, but they are NOT repeated in the tag close. Here's an example:

The attribute color="green" has extended the description of the font tag (which actually doesn't do much of anything unless you add an attribute) to describe the color of the font. You could also add a size=+1 attribute to make the text one size larger than the basic font. Computers can display a face="fontname" attribute, but WebTV can't. On the other hand, WebTV has some special font attributes of its own that you'll find in the WebTV Toybox.
When you add a hot link to your page, you are actually using an anchor tag <a>, with an href="page_URL" attribute. The "href" means HyperText REFerence, and it tells the browser where to go when the text or picture inside the anchor container is clicked. Here is the way you add a hot link to go to Net4TV, and right below the HTML is the actual link the code creates.
Net4TV
Most of the process of creating your page will be using tags to tell the browser what to do with the content inside a container. ALL tags have opens and closes, so you should remember "wax on, wax off." Most of the problems that people have with their HTML is simply forgetting to close their tags.
There is only one tag where putting both an open and close is optional: the paragraph. The proper way is to open a paragraph with a <P> and close it with a </P>. But, since all of the modern browsers understand that if you're opening a paragraph with a <P>, it means you're finished with the previous one, they don't require you to use both tags. You may, or you may take your choice: use <P> to open, or </P> to close (and signal the start of a new paragraph following), or both.
If you've already been working on a home page, you're probably thinking "but there are a few tags like <br> that don't have a close." Actually, these aren't tags, they're commands. Remember, tags create containers that describe what goes on inside them. <br> is simply a command to the browser that says "put a line break here." Many HTML books don't make this distinction, and call everything inside <> brackets "tags" or sometimes, "commands." You can tell which is which with a simple meditation:
Am I creating a container to describe what goes on inside (it's a tag that must be closed), or am I issuing a directive to the browser to do one thing (it's a command that stands alone).
When you're ready for the next meditation, click here.
Dudette
|