Tag, You're it. Basic Markup

Tag, You're it. Basic Markup


Navigation:    Home    Tag, You're it. Basic Markup    Navigation, Anchors & Links    Graphical Elements    What Next?


All websites consist of one or more webpages. The first page is usually named index.html or index.htm. This tells the Web Server what page to automatically load when a browser (Internet Explorer, Netscape, Mozilla, etc) comes to, or hits, the site. Naming any other pages is left to the person creating the page.

HTML (Hyper Text Markup Language) is a markup, or tag, language. You must always, with a few exceptions, begin and end with a "tag". Tags are usually not case sensitive. HTML tags are encased in '<>'s. A simple example would be <tag>Your Information Goes Here</tag>. Although <tag> is not an actual html tag, it does show us the pattern that beginning and ending html tags must follow.

Let's look at real tags and how to use them to create a webpage.

There are eight sections we will discuss here:


Basic Tags


The basic set of HTML tags that all HTML webpages require are the html, head, and body tags with their associated closing tags. These three, like other tags, will each encompass its own data. The html tag must encompass the entire HTML page including the head and body tags. Putting these three tags into a text file and saving the file as index.html gives us the basic building blocks for an HTML file template. You could also just cut and paste this text from your browser into a blank text document and do a Save As, calling it index.html.

    <html>
       <head>
       </head>
       <body>
       </body>
    </html>
    

The visible information would actually go between the body tags.

Although we live in a world where bigger is usually better, a larger file name is not necessarily good. You may know, without a doubt, what a file is by calling it 'My Website Is So Cool You Just Have To Visit It.html', but keeping it smaller and cleaner ensures that all web servers can host your webpages and makes for fewer typing mistakes. We'll learn more about this in 'Navigation, Anchors & Links'


Header Tags


Have you ever noticed how web pages display a user friendly title in the upper left border of a browser? That is accomplished by using the <title> Tag in the <head> Tag.

    <html>
       <head>
          <title>
             A Writer's Web Site
           </title>
       </head>
       <body>
       </body>
    </html>

Save this template and open it with Internet Explorer or Netscape, You should see your title in the upper left border, as in the example below.


BODY Attributes


The body tag has attributes you can give it to change the color of the body's different areas. The available attributes are:

Let's look at each of these and how to use them. Remember that you can use any of them, all of them, or none of them at the same time. But first, you need to understand what a Hex Number is. A Hex Number, or Hexadecimal Number, is a "number" with characters 0 - 9 and A - F and is usually 6 characters long. An example would be '#FF0000'. The "#" tells the browser that the following text is a hex number rather than plain text.

bgcolor=""
bgcolor is used to set the background color. You can use a name or Hex value. To use bgcolor attribute:
<body bgcolor="red"> or <body bgcolor="#FF0000">
text=""

text is used to set the text color of the entire webpage, although the font tag can override this. To use the text attribute:
<body text="red"> or <body text="#FF0000">

link=""

Link is used to set the color of all of the unvisited links on the page. To use the link attribute:
<body link="blue"> or <body text="#0033FF">

vlink=""

vlink is used to set the color of any links that have already been clicked on. One little "secret" webmasters have used is to set the vlink and the link attribute to the same color. That way it won't appear that you have clicked on a link, and it helps them keep their color scheme together. To use the vlink attribute:
<body vlink="blue"> or <body text="#0033FF">

alink=""

alink is used to set the color of a link while you are clicking on it. Sometimes the default color may not match your background or text color scheme. You can control it here. To use the alink attribute:
<body link="black"> or <body text="#000000">

Text Tags


Text Tags are used to format blocks, or groups, or text. A comparison would be the Format>Paragraph or Format>Font feature of popular word processors. There are several Text Tags that we will be looking at. They are:

Although most of these tags are self-explanatory, let's looks at some that aren't.

the pre tag

The <pre> tag is used for Preformatted text. Everything
Will be displayed EXACTLY as you type it in. The <PRE> tag     honors multiple spaces, Tabs, and
line breaks. The text within the <pre> tag is usually displayed in   a monospace font. But
this is a fantastic way to display your work without having to go back and add a lot of
html code tags to get your work looking like it does in print.
Notice that I have some lines longer than others and some with multiple spaces.

font size Attribute

The font size tag has seven different sizes. They are:
  • <font size="1"><font size=1></font>
  • <font size="2"><font size=2></font>
  • <font size="3"><font size=3></font>
  • <font size="4"><font size=4></font>
  • <font size="5"><font size=5></font>
  • <font size="6"><font size=6></font>
  • <font size="7"><font size=7></font>

font color attribute

The font color attribute is used very similarly to the body tag's bgcolor attribute.
  • <font color="red">red</font>
  • <font color="#ff0000">#ff0000</font>

Text Formatting


Text Formatting allows us to perform additional formatting to a line or paragraph. These are similar to Text Tags. They are:

A normal paragraph with a bunch of dashes to show the width of this paragraph compared to the following paragraph = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = !

This paragraph, using the <blockquote>...</blockquote> tag pair, demonstrates the usefulness of this tag. We could use quotes from famous people, excerpts from reviews, or anything else we really wanted to stand out as a unique paragraph. Note that it's indented on both sides.
Another normal paragraph.


Lists


Finally we have List Tags. if you notice, up above, all of the styles have a dot, or disc, beside them. We have used a List Tag. There are three basic styles:


You can put a List inside another List as we have nested two lists at the top of this page. This is done by putting the MAIN tag (<dl>...</dl>, <ol>...</ol>, or <ul>...</ul>) with its inner <li>items</li> in place of a <li>...</li> pair of the outer List tag set. Each List tag has its own uses. Let's look at them individually...

Definition Lists

A definition List consists of three sets of Tags: <dl> <dt>, and <dd>. The <dl> tag is useful for listing a series of terms of definitions.
Sample usage:
<dl>
     <dt>Definition Term (Usually a good idea to make this BOLD and/or ITALIC) </dt>
     <dd>Definition Portion </dd>
</dl>

Here's a sample definition list:

Term Goes Here
Definition of term goes here
Term Goes Here
Definition of term goes here
Term Goes Here
Definition of term goes here

Ordered Lists

An Ordered List consists of two sets of Tags: <ol>, and <li>. The <ol> tag is useful for listing information where order is emphasized, like a table of Contents or a recipe.
Sample usage:
<ol start="Start" type="Type">
    <li>List item 1</li>
    <li>List item 2</li>
</ol>
the Start parameter tells the starting number to use. There are five different styles for Type attribute:
  1. 1 - Uses Arabic Numerals (1,2,3,4...) - this is the default
  2. A - Uses Uppercase Letters (A,b,C,D...)
  3. a - Uses Lowercase Letters (a,b,c,d...)
  4. I - Uses Uppercase Roman Numerals (I, II, III, IV...)
  5. i - Uses Lowercase Roman Numerals (i, ii, iii, iv...)

Unordered Lists

An Unordered List consists of two sets of Tags, just like the Ordered List: <UL>, and <li>. The <UL> tag is useful for most other types of lists. It uses one of three different bullets to separate each List Item.
Sample usage:
<ul type="Type To Use">
    <li>List item</li>
    <li>List item</li>
</ul>
There are three bullet styles for Type items:
  • disc - this is the default
  • circle
  • square

Table Tags


Have you ever noticed how some sites just seem to get their data on the page lined up perfectly? Sometimes it may look like a table, or spreadsheet view. Other times there are no lines? They are probably using tables to display text. Tables are similar to the List tags in that you can have a table within a table. Here are the tags:

Here is a simple table layout:
<table>Table Name Can Go Here
<th>Cell Data 1 Title<th>Cell Data 2 Title<th>Cell Data 3 Title
    <tr>
        <td>Cell Data</td>
        <td>Cell Data</td>
        <td>Cell Data</td>
    </tr>
    <tr>
        <td>Cell Data</td>
        <td>Cell Data</td>
        <td>Cell Data</td>
    </tr>
</table>
So this would really look like:

Table Name Can Go Here
Cell Data 1 TitleCell Data 2 TitleCell Data 3 Title
Cell Data Cell Data Cell Data
Cell Data Cell Data Cell Data


Table Tag Attributes


Finally, we have the attributes for the Table tags. Although there are many, we will only cover those that are likely be most useful to you. They are:

The <tr valign=""> and <td valign=""> are useful when you have more data than a single column. The cell height will auto-adjust to accommodate more data, so vertically aligning certain cells, like a title, can give it a more professional look.


Conclusion


Now that we've covered the basic tags, let's look at our template, and how it should look, using some of the above tags. Don't forget to copy and paste this template so that you may use it over and over for every webpage you want to create.

<html>
    <head>
        <Title>
            My Writer's Web Site
        </Title>
    </head>
    <body>
    <!-- Let's Bold our Name -->
    <b> Author's Name Goes Here</b>
    <!-- Let's add a new line, as html will read each line as one BIG line -->
    <br>
        <br>
        Let's write a short paragraph about the  Article/Book/Short Story.
    <table border=5 width="50%" align="center"><center>Stories I have written</center>
        <th>Name of Article/Story<th>Description<th>Where can you find it
        <tr>
          <!-- Italicize the name of our article -->
          <td><i>My First Article</i></td>
          <td>This article was written when I was in 12th grade, but I enjoy it so much I think you would too.</td>
          <td>Link to Article Will go here</td>
        </tr>
        <tr>
          <!-- Italicize the name of our article -->
          <td><i>My Second Story</i></td>
          <td>I am still working on this, and will post it here, or the URL where it is published.</td>
          <td>Not Published Yet</td>
        </tr>
    <table>
    </body>
</html>

NOW we have a useful template to use, and we know what tags are and how to use them to create a web page.

These basic tags will allow you to create a website. There are many more, but these are the ones that you will probably use most.

There are two more helpful things I want to show you in this section:
Click this link to Webmonkey to find the
Special Character Codes
Click this link to Webmonkey to find the Color Codes for wherever colors can be specified.

Navigation:    Home    Tag, You're it. Basic Markup    Navigation, Anchors & Links    Graphical Elements    What Next?


Created on ... January 24, 2005