HTML stands for Hypertext Markup Language which is a language that browsers use to interpret the text you prepare.
When working with text being prepared for browsers, there are several things you must take into consideration.
For starters, the browser sees no difference between
These
words
are
typed
| one | word | per | line | or with strange | spacing |
and
These words are typed one word per line or with strange spacing
In other words, spaces and carriage returns are not honored in the usual way.
| Q. | So how do I force text to go to the next line? |
| A. | By inserting the code <br> or the code <p> . |
| Q. | What's the difference between <br> and <p>? |
| A. | They are
different types of line breaks, with different spacing between lines.
|
| Q. | I am used to typing in ALLCAPS. Why not use ALLCAPS for a web site? I think that would be cool! |
| A | Wrong. Cool it is not.
If I can put that to rest, then, you will prepare things using mixed case mode, and you will start by taking normal text and inserting <p> wherever a new paragraph begins. Try looking at such text before and after you insert the paragraph codes. The <br> codes can be used to form some simple lists - though later you will find far more effective ways of doing that. Of course, before you can look at it with a browser, you must save it in ASCII Text format. You can use a word processor to prepare it, but you must be very careful when saving the file - make sure that the File Type selected is Web Page, or ASCII text, and the filename ends in .HTM or .HTML.
|
| Q. | Anything I boldface in my word processor will be lost. So how can I get something to show up in boldface? | ||||||||||
| A. | The Break and Paragraph codes are
called tags. Boldface, by its nature, requires a different kind of code.
Boldface is a feature that must be turned on and turned off. The
preferred way to accomplish this at this point is to use <strong> and
</strong> and sandwich in between all text to be emphasized. For
example, if you type:
This is a word to be <strong>emphasized </strong> the browser will show the result This is a word to be emphasized |
||||||||||
| Q. | What other features are controlled this way? | ||||||||||
| A. |
Here's a list:
|
||||||||||
Therefore the barest of outlines is:
| <html> | |
| <head> | |
| Header material | |
| </head> | |
| <body> | |
| Tables, Text, Graphics, Links | |
| </body> | |
| </html> |
If a Filename is highlighted, and it is neither text nor graphics (it may be a program file) then clicking on it will allow the visitor to download the file.
The basic ingredients are <a href="somewhere">Link Text</a>
Here are some examples:
Tables are appropriate whenever you want to fine-tune the placement of text on your web page. HTML tags give the options Left, Center, and Right. If your text appears to the right or left of a graphic, you get almost no control of the way that text can appear. To get the effects we want, we often have to turn to tables. This expands that control considerably, though not yet completely.
A table can appear with or without a border. "Border" is called an attribute. To turn a table on with a border, use <table border> and to turn a table on without a border use <table>. In both cases, you must remember to turn the table off with </table> or else your text will appear to disappear into nowhere.
When the border attribute is turned on, all cells in the table appear with a border around them. Sometimes this can be used quite effectively.
Each row of a table begins with <tr> and each cell within a row begins with <td>.
Therefore, the bare-bones table code looks like this:
| <table> | <----- Start a new table |
| <tr> | <----- In that table, start a new row |
| <td> | <----- In this row, start a new cell |
| Content (text or graphics) would go here | |
| </td> | <----- End this cell |
| </tr> | <----- End this row |
| </table> | <---- End this table |
Here is a table with two rows and 4 cells in each row, with a border:
| 1995 | Providence | RI | Narragansett Bay Chorus |
| 1996 | Portland | ME | Narragansett Bay Chorus |
And here is the same table without a border.
| 1995 | Providence | RI | Narragansett Bay Chorus |
| 1996 | Portland | ME | Narragansett Bay Chorus |
And here is the same bordered table centered (simply include the entire table between <center> and </center>.
| 1995 | Providence | RI | Narragansett Bay Chorus |
| 1996 | Portland | ME | Narragansett Bay Chorus |
Note that in any cell, you can put any valid kind of object that can go on a web page. This includes text as well as images. In either case, you type the information inside of the cell or place the source code for the graphic inside of the cell.
Tables however are scanned three times before the contents of the table are displayed. Tables slow down the page load. Since virtually all well-designed pages make extensive use of tables, it is best to learn how to speed up the display. This is done by adding something to the table tag, as follows:
<table style="table-layout:fixed">
Images can sometimes be very big files. When they have to be sent from one computer to another, it can take a lot of time. And that is what happens when you open a site that shows graphics - the images are downloaded to your computer.
So what is really happening when you right-click to download? It is already on your computer; it just copies it from the cache area where the browser put the image to the folder you specify.
To help this process, two file formats have been developed that the browser can interpret. They are JPEG (JPG) and GIF. Both of these are compressed, so their file size is much smaller than their non-compressed cousins. This means that they can be sent to your computer faster.
Therefore, when you obtain an image, it has to be saved in one of these formats. Frequently the JPG is a smaller file size for photographs, and GIF is the smaller file for graphics you create yourself with graphics programs.
There are many sources for graphics. You can buy disks full of graphics or you can download them from the Internet. Many places now offer you a service when you have your films developed there - they can return it to you on a floppy disk along with a program to view them. Yet another way is to have them scanned.
Whatever your source, it is possible that your pictures will not arrive into your computer in the format you need (GIF or JPG). If this is the case, you need a graphic converter. Some public domain programs like Graphics Workshop work well. But programs like Corel PhotoPaint also will perform this task. The idea is to load it into the software as one type of file and save it as another type. When you attempt this, you should be aware that it is not enough simply to NAME the file using JPG or GIF extensions. Using whichever software you have, you must select the File Type to agree with the extension you choose. If you get them from the place where you have your films developed, they will arrive with a program for viewing; the same program will also convert them.
When you have the file in one of these formats, you get the browser to place the image somewhere by using the <img src=" ... "> technique. You put the filename inside of the quotes - and the file can be anywhere in the world. If the file is not at the same web site, you must insert the complete name of the file. Here are some examples:
Return to Table
of Contents
I prepared this for several reasons:
Please keep these things in mind as you explore this. There truly is a bewildering array of possibilities and details that could be included. I want to keep it down to the very basics that can be of assistance in constructing a good, basic Web Page.
As a result, I will not try to be everything for everybody. This is for beginners who want to get their feet wet before trying more herculean things like image maps and frames and Java scripts.
It has been my experience that even in the early stages, people want to get involved with the appearance of the backgrounds in their pages. People like working with colors and images as a backdrop for their message. I decided therefore to provide the basic information for doing this.
Remember that there is a <body> tag in every HTML document, or there should be. Remember also there there can be only one <body> tag. If you insert more than one <body> tag, only the very first will be honored.
The <body> tag can be expanded with what is called "attributes." To change the color of the background, you insert a "bgcolor" attribute as follows:
<body bgcolor="nnnnnn">
where the n's must be replaced with numerals 0,1,2,3,4,5,6,7,8,9, or letters a,b,c,d,e,f.
Grouped in two digits, these numerals control the mix of Red, Green, Blue.
You can also name the colors by name, if you know the name. For a list of color names, their corresponding numbers, and a view of the color itself,
Now this is the barest of things here, and to understand it, you must work with things you have not considered before - but it is an adventure.
To begin with, if you change the background color, you may render certain things invisible. In extreme form, suppose you changed the background color to black. Then you could not read the text, which is also black. So readability is an important issue when working with colors.
Let's start with the fact that certain color combinations are not advisable. Many are color blind, and producing red text on a green background can cause some a lot of grief. Garish colors in the background, such as bright purple, can also produce such negative results that people won't want to read your pages.
Whatever color you pick, the text should be in a color that has sufficient contrast to make it easy to read. Dark grey text on black background is very hard to read, so it is annoying to the reader. This author has seen several pages designed by real "designers" which are offensive to the viewer in this respect.
It is clear then that when you manipulate background colors, you may also want to change text colors, and there are several kinds of text colors that you need to look at.
So a "body tag" could look like this:
<body bgcolor="#000000" text="#00ff00" link="#ff0000 vlink="#0000ff">
to say the least.
There are a total of 256 colors to choose from. To know them all by number is asking a bit much. So the colors all have been given names! You can then use the names instead of the numbers. So, for example, you can use bgcolor="black" and text="white" to obtain white text on black background. the basic colors will work as expected - red, blue, purple, yellow, green, orange, cyan, magenta, chartreuse, teal, acqua to name a few. The names of the colors however themselves can grow be a challenge.
Although this discussion has been in the context of setting background colors for the entire body of the page, the same rules apply to table cells. You can add any of these attributes within a cell of a table to control colors of that cell. For example,
<table border=8>
<tr>
<td bgcolor="red"
text="white">Left Cell
<td bgcolor="cyan" text="red">Right
Cell
</table>
Will produce a table with two cells - one of them with a red background, the other with a cyan background, as follows:
| Left Cell | Right Cell |
Any image that the browser can show can be used as a background image. That is to say, one can use any .GIF or and .JPG file. Once again, you use the body tag to accomplish this. The syntax is as follows:
<body background="image.gif">
The image will be used to tile the background of the page. Remember however that text will be flowing over the image. This means that color considerations discussed above are still important. If the background image is dark, you should be careful to set the text color light, so that the text is visible.
A backgound image should not therefore contain Caution: HTML tags are not themselves case sensitive. However, when you
name the background image, remember that many host systems are
case sensitive.