HTML stands for Hypertext Markup Language which is a tag-based language that browsers use to render the information that arrives on your computer.
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 a picture? 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.
Further, if you prepare a Mathematics document in Word and save it as HTML, Word will create a folder to contain graphics representing any well-formed math expression from Equation Editor (or MathType) and all graphs from any source. If you named the file MathLesson.htm then Word will create a folder called MathLesson_files. A fairly simple Math Lesson could contain 40 - 70 such graphics, all huddled in that one folder.
When you have the graphics 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:
<img src="myhouse.gif">
This will cause the image named myhouse.gif to inserted on the page where the code appears.
<img src="http://www.rodsweb.org/george/myhouse.gif">
This will cause the image named myhouse.gif to inserted on the page where the code appears. This file will be found on a computer whose domain name is www.rodsweb.org in a folder named george.
Your page will load faster if you add a couple of things to the <img> tag - the height and width of the image. To figure out what that is, you can load the image into a Paint program, then tell the program that you want to resize or resample it. Study the resulting screen. It may in fact tell you the height and width. However, make sure that you read the number of pixels (not inches) in the height and width. The tag
tells the browser to display the image using 100 pixels in height and 300 pixels in width. Since no path is specified for the image, the browser will "look for it" in the same folder as the html file.