introsubmainglosscontact
arrow left arrow right

    Document Tags

    In this lesson, it is advised that you should attempt to work along with the examples shown and enter the HTML fragments into your own HTML documents as you work through the lessons. Original HTML documents, containing HTML markup codes are often referred to as "source" documents, or just "source". Although it is not required it is a good idea to use the ".html" (or ".htm"in PC's) file extension name when saving these documents, this may make things easier later on. (e.g. "myfile.htm")

    You will be asked to send the completed html file to us in the training report sheet below.

    "Document tags,"refer to the tags which divide up a Web page into its basic sections, such as the header information and the part of the page which contains the displayed text and graphics.

    HTML
    The first and last tags in a document should always be the HTML tags. These are the tags that tell a Web browser where the HTML in your document begins and ends. The absolute most basic of all possible Web documents is:

    <HTML>.....</HTML>

    HEAD
    The HEAD tags contain all of the document's header information. Header information includes things like the document title and so on.

    TITLE
    This container is placed within the HEAD structure.

    Between the TITLE tags, you should have the title of your document. This will appear at the top of the browser's title bar.

    the contents of the TITLE container go into your bookmark file, if you create a bookmark to a page thus should be relevant to the content.

    You should only have one TITLE container per document.

    BODY
    BODY comes after the HEAD structure. Between the BODY tags, you find all of the stuff that gets displayed in the browser window. All of the text, the graphics, and links, and so on all occur between the BODY tags.

So, putting everything we've covered thus far into one file, we have:


<HTML>

<HEAD>
<TITLE>Document Title</TITLE>
</HEAD>

<BODY>





This is where the content of your web page will go.





</BODY>
</HTML>


This time, the result would be a document with a completely blank browser window, but at least the words "Document Title" would appear in the browser's history list. Try this yourself, using microsoft notepad or a simple editor, replace the words Document Title with whatever you want to be displayed in the browser window.

  • Comment Tags
If you want to leave yourself notes in an HTML document, but don't want those notes to show up in the browser window, you need to use the comment tag. To do that, you would do the following:

  • <!-- Hi, I'm a comment. -->

Your note would go where the text Hi, I'm a comment. appears. You do need an exclamation point after the opening bracket, but not before the closing bracket. That's the way the standard is written.
Also, there is no end tag; that is, a tag like </!-- text --> does not exist. The comment tag is not a container. This is our first example of an empty tag.

What if you get the tag wrong, like forgetting to include the exclamation point? In that case, the text you did type in would be displayed. See for yourself, and then take a look at the same thing with correct markup (the exclamation point was put back in). You should see another totally blank page!

Everything so far has produced producing blank browser windows, when you are ready it is time to move on to the next session, where we'll start building up your knowledge of HTML.


training report sheet

Use the information already covered to answer the following questions:-

Email address

Name


1 The majority of a typical Web document will be found in:

the HEAD container
the TITLE container
the BODY container
a comment tag

2 The TITLE container goes inside:

the HEAD container
the TITLE container
the BODY container
a comment tag

3 An HTML document could be one long line of tags and still be valid.

True
False

4 HTML tag-pairs do not have to be nested inside of each other.

True
False

5 Place the source HTML code from this session into this box.

arrow left arrow right
introsubmainglosscontact