Tuesday, March 3, 2009

introduction to HTML

This collection of pages explains how to use the different HTML document description elements, or tags and how to use these elements to write good, well designed HTML documents. This particular page describes the overall content and organization of the material presented here, reviews some related resources that may be of interest, and describes the meanings of the navigational "buttons" you use to navigate from page to page.

What is HTML

HTML are initials that stand for Hyper Text Markup Language

* Hyper is the opposite of linear. It used to be that computer programs had to move in a linear fashion. This before this, this before this, and so on. HTML does not hold to that pattern and allows the person viewing the World Wide Web page to go anywhere, any time they want.
* Text is what you will use. English letters, just like you use everyday..
* Markup is what you will do. You will write in plain English and then mark up what you wrote.
* Language. Some may argue that technically html is a code, but you write html in plain, everyday English language.

HTML is the code behind your webpage and is what your browser looks for to display a webpage, the way the webdesigner intended it to look, and is a series of tags that tells the browser where to display what. It is really a series of simple commands that you give to the browser, just like telling your dog to sit, and because it is in plain English it is easy to learn. For example, if you want your text to show in a bold type, you command it to be bold text , it really is that easy.

Keep this in mind: HTML documents must be text only.
When you save a HTML document, you must save only the text, nothing else. HTML browsers can only read text. Look at your keyboard. See the letters and numbers and little signs like % and @ and *? There are 128 in all (read upper- and lowercase letters as two). That's text. That's what the browser reads. It simply doesn't understand anything else.

Remember that if you are using Notepad, Wordpad, or Simple Text, the document will be saved as text with no extra prompting. Just choose SAVE.

If you are going to start learning to write HTML, it is a good idea to learn to look at other authors' HTML pages. The actual html potion of the page behind the pretty page you see in front of you now.

Looking at another's html code helps you learn how things are done and you can copy the style of pages that you like. Please do not just steal and copy the pages, but no one will be upset if you make the style in much the same way. For example, if you were going to build a house, you would look around to see what styles you like before deciding on your own design. Same thing here, look around the web and see what styles you like and apply them to your own ideas.

Here's how you look at an HTML document (known as the "source code")

* When you find a page you like, click on VIEW at the top of the screen.
* Choose SOURCE from the menu.
* The HTML document will appear on the screen.

Try it with this page. Click on VIEW and then choose the SOURCE.
It will look like mumbo jumbo right now, but soon it'll be readable and you'll be able to find exactly how a certain HTML presentation was performed.


What are HTML Tags?

HTML works in a very simple, very logical, format. It reads like you do, top to bottom, left to right. HTML is written with TEXT. What you use to set certain sections apart as bigger text, smaller text, bold text, underlined text, is a series of tags.

Think of tags as commands. For example if you want a line of text to be bold. You will put a tag at the exact point you want the bold lettering to start and another tag where you want the bold lettering to stop. There you have an example of how tags make commands and tell the browser how to display the text. Just like telling a dog to sit. You give the command.

All tags that are opened must correspondingly be closed, just as if you are writing a quoted statement with those "inverted commas". A tag is closed this way therefore we open a new tag and close the tag

Basic HTML Tags

What Is a Tag?

* A tag is a method of formatting HTML documents.

* With tags you can create italic or bold characters, make things blink, and can control the color and size of the lettering.

* Tags can be "nested". This means that you can make something bold and italic and green and blinking by simply surrounding the previous tag with the next.

* Tags can be used to insert pictures and graphics.

* Tags can be used to create bulleted lists like this one, or numbered lists.

* Tags look something like this: chosen text .

* All tags use the < and > (less-than and greater-than symbols) to signal the browser. These are located above the comma and period keys.

* Within a tag, capitalization doesn't matter. FONT is the same as font or Font . I usually don't bother capitalizing when I use tags. Below, I have used capital letters when I felt that the number "1" and the letter "l" might be confused.

* It is essential to always close the tags! If not, the formatting will contaminate everything that follows it. But don't panic, closing tags is very easy, and even the most experienced surfers sometimes forget.

Italics
To make italics surround the chosen text with these tags:

chosen text

The "/i" tag is essential; this will close the tag and stop the italics. If this is not done, all the text which follows the first, i , tag will appear italicized.

Bold Lettering
To make letters bold surround the chosen text with these tags:

chosen text

The "/b" tag is essential; this will close the tag and stop the bold lettering. If this is not done, all the text which follows the first, b , tag will appear in bold.

Changing Font Size
There are three different ways to change the size of the font. Method 1, Method 2, and Method 3.
Also see below on how to change both the size and the color of the font at the same time.

1. The first method is to use the "big" and "small" tags.

For example, to increase the font by one degree surround the text with the following tags:

chosen text

If you want to make it even bigger, you surround it again:

chosen text

To make the font small, surround it with the small tag:

chosen text

If you want to make it even smaller, surround it with the tag again:

chosen text

The "/big" and "/small" tags are essential; they will close the tag and stop the special formatting. If this is not done, all the text which follows the first, or , tag will appear in the altered size.

2. The second method is to directly change the font size.

You can use + and - along with a number to shrink and grow the font:

chosen text

chosen text .........(same as )

chosen text .........(plain text)

chosen text .........(same as )

chosen text

Notice that when you get to larger fonts they tend to appear bold.

The " /font " tag is essential; it will close the tag and define the end of the specialized formatting. If this is not done, all the text which follows the first, font size= , tag will appear in the altered size.

3. The third method is to use what are called headers.

Headers are abbreviated with the letter "h" and a number from 1 to 6. For example:

chosen text


Along with the tag, I will demonstrate the result for each:

chosen text


chosen text


chosen text


chosen text


chosen text

chosen text


Notice that the header method also utilizes a bold font.

The "/h# " tag is essential; it will close the tag and define the end of the specialized formatting. If this is not done, all the text which follows the first, , tag will appear in the altered size.

Blinking Text
To make text blink surround the chosen text with these tags:

chosen text

Note: This will not show up if you are using Microsoft Explorer (Blame it on Bill Gates!).

The "/blink" tag is essential; this will close the tag and signal the end of the special formatting. If this is not done, all the text which follows the first, , tag will blink.

Use this sparingly, it can get a bit obnoxious if used overfrequently.

Changing Text Color

To change the color of the text surround the chosen text with the following tags:

chosen text

The "/font" tag is essential; this will close the tag and signal the end of the colored text. If this is not done, all the text which follows the first, font color= , tag will appear in the altered color.

The "color name" can be one of two things. If you only want to use a common color, you can simply put in the name of that color. This works for the following colors:

Black
White (White)
Yellow (Yellow)
Orange
Pink (Pink)
Red
Green
Blue
Purple
Cyan (Cyan)
Magenta
Maroon
Brown

The second thing you can use as a "color name" is a numeric code for the color. This allows you to fine tune the color more than you can with the fixed colors listed above. For example you can have a deeper shade of blue, or a lighter brown.

To use this option you type:

chosen text

Where "#rrggbb" is the code for a color. Don't forget the quotation marks or the # sign--they are necessary.

The "/font" tag is essential; this will close the tag and signal the end of the colored text. If this is not done, all the text which follows the first, font color= , tag will appear in the altered color.

Here is a short list of some of basic colors:

Here is a yellow color whose hex-code number is-- # f f f f 0 0 . (# f f f f 0 0)

Here is a red color whose hex-code number is-- # f f 0 0 0 0 . (# f f 0 0 0 0)

Here is a green color whose hex-code number is-- # 0 0 f f 0 0 . (# 0 0 f f 0 0)

Here is a light-blue color whose hex-code number is-- # 0 0 f f f f . (# 0 0 f f f f)

Here is another blue color whose hex-code number is-- # 1 f 8 1 a 6 . (# 1 f 8 1 a 6)

Here is a blue color whose hex-code number is-- # 0 0 0 0 f f . (# 0 0 0 0 f f)

Here is a purple color whose hex-code number is-- # f f 0 0 f f . (# f f 0 0 f f)

For a more complete list of colors, here is a chart with their hex-code names:

Color Chart

Changing Text Font

Changing the font of text online is one of the most frustrating parts of formatting for the web, because you never know what the person on the other end is going to see.

The reason for this is that the fonts you choose to use must already be loaded on the other person's computer. If they aren't, then they will just see their default font.

For example, if you really, really want to use "Tigerteeth ICG", because you think it looks great and is perfect for your site, you probably shouldn't bother. Few people will have "Tigerteeth" loaded on their machine, and only those who do will see it--everyone else will just see their default font (usually something like Times New Roman). To make matters even more complicated, Mac users will usually have a completely different set of fonts, so you need to think of them when choosing your font. There seems to be little or no standardization of fonts, some machines will contain one set, while another could have a very different set.

So, is it hopeless? Not entirely. If you want to use a really fancy font, which may be rare, or which you might have downloaded from a font website, then don't bother or find another way. But if you want to use a fixed-width font instead of a varying one, or if you want to use a sans serif font (one without those tiny little cross pieces which finish off letters) instead of one with them, you can do it. In other words, if you want a bit of a change, but aren't particular about what that change is, go ahead.

If you want to use less common fonts, you can go ahead and do so. The trick then is to pick several different fonts and use them all. This is similar to choosing the font you most want, then the second most-wanted one, then the third most-wanted, etc. When someone views your page, if they have the first font, that's what they'll see. If they don't, then they might have the second, and that is what they'll see. If not the second, then maybe they will have the third. With several fonts listed, you increase the possiblity that the other person will at least have one of them.

So, here's how to do it. Surround the chosen text with the following tags:

chosen text

Notice where the quotation marks are--outside the entire list of fonts, not around each font.

The "/font" tag is essential; this will close the tag and signal the end of the colored text. If this is not done, all the text which follows the first, font face= , tag will appear in the altered font.

The "font name" is the name of the font, for example: Times New Roman, Arial, Verdana, Helvetica, or sans serif.

Examples:

"...The respect created by the conviction of his valuable qualities, though at first unwillingly admitted, had for some time ceased to be repugnant to her feeling; and it was now heightened into somewhat a friendlier nature, by the testimony so highly in his favor, and bringing forward his disposition in so amiable a light, which yesterday had produced. But above all, above respect and esteem, there was a motive within her of goodwill which could not be overlooked. It was gratitude; gratitude, not merely for having once loved her, but for living her still well enough to forgive all the petulance and acrimony of her manner in rejecting him, and all the unjust accusations accompanying her rejection..."

--Jane Austen, Pride and Prejudice


Pride and Prejudice and Sense and Sensibility.

Now, what if you really, really, really want to use a fancy font?

Well, if you have a large section of text, you might want to give up, but if you want to use a fancy font for titles on your page, or to make a small part of your page stand out, then you may try to use an image program to turn them into pictures:

Baronetage

One thing to keep in mind with images is the length of time they take to load into someone's browser. An entire page shouldn't be longer than about 75 KBs, text and images included. So, if you want to use a large image you will have little left for other items on the page. The image I just used above is about 4 KBs, so it won't take long to load and isn't a problem.

Nesting Tags

As can be seen above in the first method for changing font size, tags can be used together, or "nested".

For example, to make something both bold and italic use the following tags:

chosen text

or big and red:

chosen text

If you want to change both the color and the size of the font at the same time, it is easiest to do both in the same tag. For example:

chosen text

As you can see, both the color and the size tags can be combined into one, when you use the tag. It does not matter what order you use,

Of course, you can add a font too:

chosen text

Again don't forget the
to close the tag.

How To Draw A Line Across The Screen

In this tutorial the different sections are divided by lines, or rules or bars, which cross the entire screen. This is very easy to do and needs only a single tag (no closing tag is necessary).

To draw a line across the page type:




this stands for "horizontal rule", and the result will look like:



I have added a blank space above and below the horizantal rule, but usually the text would appear directly above
and below the line without any extra space, as I have just shown.



You can modify the bar in several ways.

You can make the line go across only a part of the page by specifying the width with a percentage, where 100% would mean the bar goes across the entire screen, smaller percentages make the line cross less of the screen:




results in:

You can make the line thicker by specifying the size of the bar; the larger the number the wider the bar:




Results in:

You can also make the bar look solid by adding the word "noshade" to the tag:




Results in:

and




Results in:

If you use the width command to specify how much of the screen the bar will cross, then you can also tell the browser where you want the bar to appear: in the center of the screen, to the left or to the right. If you do not specify where you want the bar to appear, it will appear centered in the screen. This can be done with by adding "align=" to the tag:




results in:




results in:




results in:

Again, the
tag is a very easy one, because you only need to put in a single tag and you do not need a second one to close the first.

How To Add Graphic Smiley Faces and Images

If you wish to add graphics such as or , the tag looks a bit complicated but I will try to explain it.

First, here is what the tag for the yellow smiley-face looks like:

=

What this means:

* IMG -- This stands for "image" and tells the browser that you are putting in a picture.

* SRC -- This stands for "source" and refers to the location on the internet where the browser can find the image. (As said above, capitalization is unnecessary.)

* http://www.austen.com/tutorial/ -- This is the location on the internet of the computer and directory in which the picture is stored.

* smiley.gif -- Is the name of the actual file for
frown.gif -- is the name of the actual file for .

* Notice that this tag stands alone, you do not need a second tag to close the first.

Note: The quotation marks around the file location (http etc.) are essential!

So the tag for pictures is: , where "internet location" is the web address of the picture. This works with any picture or graphic on the web, not just those listed here.

How To Copy The Location Of An Image

If you see a picture somewhere on the web that you would like to use, and if you are using Netscape, you can automatically copy the location of the image. That is to say you can copy a location, such as http://www.austen.com/tutorial/smiley.gif, so that you can paste it into the tag without typing it all out. If you are using MSExplorer, it is not such a simple thing to do (blame it on Bill Gates!) .

Here, I will show what to do in the case of Netscape (it differs slightly depending on whether you live in the Mac world or the PC world).

* For PC users,

1. Point at the image you want to use, and
2. Click the right mouse button (not the left, the right mouse button).
3. This will cause a menu to appear. One of the options in the menu is "Copy Image Location".
4. If you sellect this option, you can then paste the location (such as http://www.austen.com/tutorial/smiley.gif) into your tag.

* For Mac users,

1. Point at the image you want to use, and
2. Click and hold down the mouse button.
3. This will cause a menu to appear. One of the options in the menu is "Copy Image Location".
4. If you sellect this option, you can then paste the location (such as http://www.austen.com/tutorial/smiley.gif) into your tag.

If you are using MSExplorer, the best way to find the URL, is to use load the image on its own page. Use the same methods listed for Netscape, but choose the "View Image" option. Once the image is loaded all by itself onto the browser, the "Location" line at the very top of the page will contain the full URL. You can highlight it and copy it from there, then paste it wherever you want.

Pictures on the web are sometimes copyrighted, so you should be careful to make sure that they are available for general use, or you have permission from the owner to use them. All of the graphics listed here can be used freely.

Advanced Graphics Information
For more advanced information of manipulating the appearence of a graphic on a page, see Manipulating Graphics With Text

How To Make a Link To Another Web Site
Making a link, such as Jane Austen Information Page, is very similar to inserting a graphic. One major difference is that there must be a second tag to close the first one. The Jane Austen link I just used looks like:

Jane Austen Information Page

The first tag consists of three basic parts:

1. The a stands for "anchor", and is the term used in HTML to refer to links.

2. The href stands for "hypertext-reference" (I think), and tells the browser you are making a link to another web site.

3. As in the case of graphics, the full internet location of the web site you are refering to is then inserted in quotation marks after an =. The web address, http://www.pemberley.com/janeinfo/janeinfo.html, is the location of Henry Churchyard's Jane Austen page. The address for the page you are currently looking at is (probably) http://www.austen.com/tutorial/index.html.

Once this first tag is complete, anything typed after it will appear as an underlined link until you insert the second, closing, tag /a. For example, I could write the above link as

Henry's Jane Austen Page

or

Hey guys! Click here

If you do not close the tag, with the /a , then everything that follows will appear as an underlined link.

How To Indent a Section Of Text
Sometimes when quoting text or when you want to set one section of the text apart from the rest, it is useful to be able to indent it. This technique is used frequently in writing to denote long passages of quoted material. To indent a block of text surround it with the tags:

chosen text


The blockquote tag also automatically inserts a blank line above and below the chosen text.

For example:

"...The respect created by the conviction of his valuable qualities, though at first unwillingly admitted, had for some time ceased to be repugnant to her feeling; and it was now heightened into somewhat a friendlier nature, by the testimony so highly in his favor, and bringing forward his disposition in so amiable a light, which yesterday had produced. But above all, above respect and esteem, there was a motive within her of goodwill which could not be overlooked. It was gratitude; gratitude, not merely for having once loved her, but for living her still well enough to forgive all the petulance and acrimony of her manner in rejecting him, and all the unjust accusations accompanying her rejection..."


--Jane Austen, Pride and Prejudice

Once again it is very important to stop the indentation with the /blockquote tag.

How To Center a Section Of Text
Being able to center text or images comes in handy.

chosen text


The center tag also automatically inserts a blank line above and below the chosen text.

For example:
"...The respect created by the conviction of his valuable qualities, though at first unwillingly admitted, had for some time ceased to be repugnant to her feeling; and it was now heightened into somewhat a friendlier nature, by the testimony so highly in his favor, and bringing forward his disposition in so amiable a light, which yesterday had produced. But above all, above respect and esteem, there was a motive within her of goodwill which could not be overlooked. It was gratitude; gratitude, not merely for having once loved her, but for living her still well enough to forgive all the petulance and acrimony of her manner in rejecting him, and all the unjust accusations accompanying her rejection..."

--Jane Austen, Pride and Prejudice

Once again it is very important to stop the centering with the /center tag.

How To Right-Justify a Section Of Text
Since we're doing paragraph formatting, let's do right-justifying. This one is a little different, since it uses the

tag to make the formatting.

chosen text



The big thing to notice here is that the paragraph tag must be opened and closed like other tags (usually you don't need to close a paragraph tag, but here you do, since you have to tell the browser when to stop the formatting.)

For example:

"...The respect created by the conviction of his valuable qualities, though at first unwillingly admitted, had for some time ceased to be repugnant to her feeling; and it was now heightened into somewhat a friendlier nature, by the testimony so highly in his favor, and bringing forward his disposition in so amiable a light, which yesterday had produced. But above all, above respect and esteem, there was a motive within her of goodwill which could not be overlooked. It was gratitude; gratitude, not merely for having once loved her, but for living her still well enough to forgive all the petulance and acrimony of her manner in rejecting him, and all the unjust accusations accompanying her rejection..."



--Jane Austen, Pride and Prejudice

Once again it is very important to stop the justification with the

tag.

As you might be able to guess, this works with align=center as well as align=right.

In addition, you can justify both sides of text by using align=justify. This will cause the browser to space the words differently, so that they line up with the right margin:

"...The respect created by the conviction of his valuable qualities, though at first unwillingly admitted, had for some time ceased to be repugnant to her feeling; and it was now heightened into somewhat a friendlier nature, by the testimony so highly in his favor, and bringing forward his disposition in so amiable a light, which yesterday had produced. But above all, above respect and esteem, there was a motive within her of goodwill which could not be overlooked. It was gratitude; gratitude, not merely for having once loved her, but for living her still well enough to forgive all the petulance and acrimony of her manner in rejecting him, and all the unjust accusations accompanying her rejection..."



--Jane Austen, Pride and Prejudice

How To Make Bulleted Lists


1. First you must tell the browser you are making an unnumbered list by typing:



    2. Then you must denote the start of each item in the list by typing:



  • in front of the item.

    3. Then you must tell the browser that the list is complete by closing the list tag:



Notice that the
  • tags do not need to be closed.

    Here is an example:



    • Item one on list.

    • Item two on list.

    • Item three on list.



    Results in the following list:

    * Item one on list.
    * Item two on list.
    * Item three on list.

    Notice that the list is automatically indented.

    You can also specify what type of bullet you want to use:

    * If you want to use a hollow circle, add to the starting tag: type=circle, so it looks like UL type=circle.

    * If you want to use a filled square, add to the starting tag: type=square, so it looks like UL type=square.

    How To Make Numbered Lists

    The method for making numbered lists is identical to that for bulleted lists. The only difference is that instead of an unnumbered list (UL) it is an ordered list (OL). So just replace the "UL's" in the last section with "OL's" and you have it:

    Here is an example:



    1. Item one on list.

    2. Item two on list.

    3. Item three on list.



    Results in the following list:

    1. Item one on list.
    2. Item two on list.
    3. Item three on list.

    Again the list is automatically indented.

    It is also possible to change the style of the numbers from 1. 2. 3., to A. B. C., a. b. c., I. II. III., or i. ii. iii.

    1. For capital letters add type=A to the starting tag: OL type=A.

    1. For lower-case letters add type=a to the starting tag: OL type=a.

    1. For capital Roman numerals add type=I to the starting tag: OL type=I.

    1. For lower-case Roman numerals add type=i to the starting tag: OL type=i.

    Note: This is one of the few cases in HTML where capitilization is necessary: types "A" and "a" give different results, and "I" and "i" give different results.

    For example (I'll only show one of these):


    1. Item one on list.
    2. Item two on list.
    3. Item three on list.


    Results in the following list:

    1. Item one on list.
    2. Item two on list.
    3. Item three on list.

    Using these techniques and by nesting the lists, it is possible to create outlines:

    1. Introduction
    2. The Basics
    1. What is an HTML tag?
    1. Formatting text
    2. Syntax
    1. Uses
    2. Usually used in pairs.
    3. The second tag closes the first
    3. Capitalization
    2. Italics
    3. Bold
    4. Size of font
    1. Font attribute
    2. Headers
    3. Big and Small attributes
    5. Color of font
    3. Advanced
    1. Inserting Graphics
    2. Inserting Links
    4. Conclusion
  • Text Formating tags

    Getting text into your web page is quite easy - just start typing between the two BODY tags. When you save your work and view it in a browser, the text will appear without any special formatting. You don't need to specify a type of font to use, or a colour, or a size. This is because browsers are set up to use defaults when no instructions are given.

    Text formatting, in html terms, is when you give the browser instructions on how your text should look. These instructions come in the form of tags, and you'll learn these now.


    Colour

    You can specify which colour you want to use for all the text on your web page. The browser default is black, so you only really need to specify a colour if you don't want black. Here's how to do it.

    *
    Start your HTML Editor
    *
    Click File > New
    *
    Set a background colour and click OK
    *
    When you see the code, locate the first BODY tag
    *
    Click your cursor after the "Y" of BODY
    *
    Press the spacebar on your keyboard
    *
    Type in TEXT =
    *
    Then type a colour for your text
    *
    In between the two BODY tags, start typing you text
    *
    Save your web page, and then view the results
    *
    In the code below, the text has been set to Blue




    If all you want to do is to change the colour of some text between the BODY tags, your HTML editor has a quick way of doing that.

    *
    Highlight the text whose colour you want to change
    *
    From the menu bar, click on Format > Text Colour
    *
    The Colour dialogue box appears
    *
    Choose a colour by clicking on a colour square
    *
    Click OK


    Headings

    You've already met the Headings tag. If you'll remember, the Heading tag uses the letter "H" followed by a number. Like this:

    My Heading



    or like this:

    My Heading



    The heading tag increases or decreases text size above or below the default size. The default size is 3. The biggest size is 1, and the smallest 7.

    The heading tag will automatically insert a line break for you, so you don't have to insert a

    or
    tag after it to start a new line.

    To insert a Heading tag with the HTML Editor, click on Insert > Heading then choose a Heading size. Only size 1 to 4 are used in the editor. But bear in mind, you can go as low as size 7.

    When you click on a heading size, the beginning and end Tag will be inserted with the cursor flashing between the two:



    The forward slash, remember, tells the browser to stop formatting a tag. In this case, stop formatting the H1 heading tag.

    With the cursor flashing between the two tags, type your text for the heading.


    Centring Text

    To centre text (and anything else on your page), the CENTER tag is used. Note the American spelling, with "ER" at the end and not "RE". To centre something with the HTML Editor, do the following:

    *
    Highlight whatever you want to centre
    *
    From the menu bar, click on Format > Centre
    *
    The two CENTER tags will surround your highlighted text
    *
    Save your work and view the results in your browser


    In this lesson, we'll continue our look at the basic text formatting tags available to you in HTML


    Bold Text

    You can make text stand out by using the bold tag.

    *
    In your Editor, highlight the text you want to make bold
    *
    From the menu bar, click on Format > Bold
    *
    The two tags will surround your highlighted text
    *
    Save your work and view the results in your browser

    Bold Text
    Italics

    The HTML tag to make text italic is as simple as the "B" tag for bold text. With your HTML editor, do the following:

    *
    Highlight the text for the italics
    *
    From the menu bar, click on Format > Italics
    *
    The two tags will surround your highlighted text
    *
    Save your work and view the results in your browser


    Subscript

    Subscript is text that appears below normal text. Like this:

    50p

    You can have Subscript in your HTML code quite easily. To format text as subscript using your HTML editor, do this:

    *
    Highlight the text you want to turn into subscript
    *
    From the menu bar, click on Format > Subscript
    *
    The two tags will surround your highlighted text
    *
    Save your work and view the results in your browser


    Superscript

    Superscript is text that is raised slightly above the centre. Like this

    24th

    To format text as superscript using your HTML editor, do this:

    *
    Highlight the text you want to turn into superscript
    *
    From the menu bar, click on Format > Superscript
    *
    The two tags will surround your highlighted text
    *
    Save your work and view the results in your browser

    PRE tag

    HTML Pre Tag

    The HTML pre tags are used to define the HTML pre element. The HTML pre element begins with the HTML
     tag and ends with the HTML 
    tag. The HTML pre element is used to direct the browser to display a section of text exactly as it is typed with spaces and line feeds included.
    HTML Pre Element Attributes

    HTML "pre" element attributes include:

    * width - (Depreciated). The "width" attribute specifies the number of characters across the screen to display. This is very rarely used. An example of its use is blockquote width="20"
    * class - The class attribute is used in conjunction with style sheets to associate an element with a class. The class attribute can set a class for specific element types or it can be independent of element types and work for all elements. The class attribute will provide the settings for specific style formatting. CSS properties are shown at the CSS Properties page.
    * ID - The ID attribute is used to apply style settings to specific individual HTML elements.
    * style - The style attribute is used to apply style settings for the specific element the style attribute is included with. An example is"

    - This sets the style or color of the text. This statement starts a paragraph with color, green:

    . The STYLE attribute is common to most HTML elements (See the CSS Properties page).
    * title - Used to give specific elements a title which may appear as a tooltip in some browsers when the mouse is held at or near the element.

    HTML Pre Element Contents

    The HTML pre element may contain other inline elements except "img", "object", "applet", "big", "small", "sub", sup". "font", and "basefont". HTML inline elements are listed at the HTML Inline Elements.
    HTML Pre Element Inside

    The HTML pre element can be contained inside the elements "applet", "blockquote", "body", "button", "center", "del", "dd", "div", "fieldset", "form", "iframe", "ins", "li", "map", "noframes", "noscript", "object", "td", and "th".
    HTML Pre Element Use Example

    The PRE element is handy for showing program code or part of file content as in this example:


    switch ( )
    {
    case condition1
    break;
    case condition2
    break;
    }


    This is how it looks:

    switch ( )
    {
    case condition1
    break;
    case condition2
    break;
    }

    CODE tag

    The code tag is designed to display computer code in a special font, usually in a mono spaced font style. However, the exact appearance will be browser dependent. You may still need to use various HTML tags, such as br and p, to create a presentation and appearance to suit your needs.

    An HTML code example cannot use the HTML delimiters < and >, because they will be executed by the browser as real HTML code. Rather you must substitute a < for the < and a > for the >.

    Usually, the display font appearance for the code, kbd, samp, and tt tags is the same for a specific browser.

    The pre tag is more commonly used to display code.

    The separate closing tag is mandatory.

    Attributes and Events

    class dir id lang onclick ondblclick onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup style title

    KBD tag

    kbd is an HTML tag that is used to specify text to be typed in by the user (usually on a keyboard). While seldom used, this tag is useful for writing documentation for computer users. While the tag usually renders text by displaying it in a monospaced font, the tag should not be used simply for this purpose.

    See also: code, font, plaintext, pre, samp, tt, var
    Attributes

    The kbd tag does not have any required HTML attributes. It does, however have numerous allowable attributes including:

    * HTML Core Attributes
    o class (type: CDATA) - space separated list of classes
    o id (type: ID) - document-wide unique id
    o style (type: Style Sheet) - associated style information
    o title (type: Text) - advisory title/amplification; this information is usually displayed through tooltips

    * HTML International Attributes (I18N)
    o dir (type: Custom) - specifies the direction of weak or neutral text; valid values include ltr (left to right) or rtl (right to left)
    o lang (type: Custom) - specifies the Language Code of the language used in the text

    * HTML Event Attributes
    o onclick (type: Script) - a pointer button was clicked
    o ondblclick (type: Script) - a pointer button was double clicked
    o onkeydown (type: Script) - a key was pressed down
    o onkeypress (type: Script) - a key was pressed and released
    o onkeyup (type: Script) - a key was released
    o onmousedown (type: Script) - a pointer button was pressed down
    o onmousemove (type: Script) - a pointer was moved within
    o onmouseout (type: Script) - a pointer was moved away
    o onmouseover (type: Script) - a pointer was moved onto
    o onmouseup (type: Script) - a pointer button was released

    Usage

    To use the kbd tag, simply place opening and closing HTML tags around the characters that should be entered by the user. For example:

    To destroy the usefulness of your computer, type del C:\*.* /S /Q at the command prompt.

    On browsers that support this tag, this will typically cause the phrase "del *.* /S /Q" to be displayed in a monospaced font. Keep in mind that the purpose of this tag is to specify text to be typed in by the user, not to format your text. If you simply want to use a teletype font, you should technically use Cascading Style Sheets or the pre tag, however there are also the deprecated plaintext, samp, and tt tags that will do this as well.