![]() WEB PAGE BASICS |
Web pages are created as text files with built in descriptors to tell a browser how to format the text, where to put graphics, and how to use color. This allows a page to be displayed in the same manner on different computers using different software (unlike a word processor document that has to be displayed using the same type of word processor to be seen the same on another machine).
I have used a table format in the examples below to make them a little more compact. But, what is true for table cells (table data) is usually true outside tables (and vice versa). Remember: keep trying. The best way to learn how to build a good page is to practice. Try the different effects and see what you can do. And, always use a real browser to view your work in progress to spot any problems or faults that might crop up. It is also a good idea to use more than one browser to preview your page. Netscape, Explorer, and Mozilla Firefox don't all behave identically. Aim for a page that views the same with all browsers and your visitors won't be disappointed.
HTML (HyperText Markup Language) "tags" (a sequence of characters enclosed with a < and a >) tell the browser how to display what follows (until the closing tag). Most tags have an ending partner that stops the effect specified. The horizontal rule <HR>, line break <BR>, and paragraph <P> are exceptions to this rule.
QUICK REFERENCE TO TOPICS
Quick Start | BODY tag | Headings | Horizontal Rulers | Aligning Text | Text Enhancements | Links | Automatic Links | E-mail Link |
QUICK START - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There is a minimum set of tags that you need to begin a web page. Below are those tags (with those that are absolutely required shown in red). You can pick "your page" to see what that code creates. You need to add your own text (page title, headings, text, etc.) to make a personal page. Any page you use will have the same basic format. The file name of your page will be of the form name.htm or name.html. If you use a hosting service like Geocities, your first page will be named index.html. Additional pages you design and use can have any name you choose. |
|
![]() <!-- Comments always have these special characters --> <HTML> <HEAD> <TITLE>your page</TITLE> </HEAD> <BODY> <H1><Your page title </H1> <HR> <!-- A rule to set off the text --> <!-- Blank lines improve readability of the source --> And here is the first of the text, with a link <A HREF="my_next.htm">to my next page</A>.
<P> <!-- Paragraph break, then a link back to basics --> |
The HTML, HEAD, and BODY tags are always required on every HTML page.Go to your page. to see what this HTML does. |
<BODY BGCOLOR="White" TEXT="Black" LINK="Blue" VLINK="Purple" ALINK="Red">
The parameters are of the form parameter="property". Always separate the parameters from each other by at least one blank space.
If none of the parameters are included (just a <BODY> tag), then all the colors will be the browser default. These colors are set in each viewer's browser.
If you specify colors here, the ones included will be used in your page (unless the viewer has specified to always use their own colors, overriding the colors specified in your BODY tag). Only the colors you are worried about need to be specified.
These parameters have the following meaning:
(use parameter="color_name" or ="#hex_code_for_color")
Headings are used to provide the structured outline for your page, although commonly the headings are mis-used just to display text in larger fonts. Headings always include a blank line before and after them, so cannot be used within a line or when different font sizes are desired on the same line. The heading number indicates the size.Note that the smallest headings have the largest numbers while the smallest FONT SIZE is the smallest number (see the next section). Headings can be centered or right justified if desired by including the ALIGN=left|center|right attribute. (Normally headings are left justified). |
H1 - HEADING 1H2 is right justifiedH2 - HEADING 2H3 is CenteredH3 - HEADING 3H4 - HEADING 4H5 - HEADING 5H6 - HEADING 6 |
A number of options are available for enhancing the text you place on your web page. There are special tags to specify text as BOLD, italicized, etc. The <FONT ...> tag will allow changing the size and color of the text. FONT changes can be set for paragraphs, words, or individual letters, allowing you a great deal of flexibility in laying out your web page.. |
Font sizes can be set explicitly . Different font sizes can be used on the same line as well. Use
<FONT ...>text</FONT> to enclose the text you want to change.The tag used for the first example here is: <FONT SIZE=1>FONT SIZE=1</FONT>
FONT SIZE=1 (smallest) FONT SIZE=2 FONT SIZE=3 FONT SIZE=4 |
|||||||||||||||||
Special tags can be used to change the characteristics of what is displayed. Some of these are shown here. Use <B>BOLD</B> to get the BOLD effect.Use <I>Italic</I> to get the Italic effect. The Emphasis element, coded as <EM>Emphasis</EM> , typically is the same as Italics, but could change in the future.Other Character formatting elements include
|
||||||||||||||||||
The <FONT COLOR="..."> tag can also be used to set text colors. (You can include both the SIZE and COLOR parameters in the tag if you want.)<FONT COLOR="Red">Red</FONT> will set the word Red to red (or any other color). You can set adjacent characters to different colors if you want. Remember to check what you have done with a browser to make sure you can read the colored text against your background. |
The horizontal rule tag, <HR>, is used to insert a line across the page to help divide topics. |
<HR> gives a simple rule, shown shaded. You can show the bar solid with NOSHADE specified (<HR NOSHADE>) You can show the bar wider (<HR SIZE=6>) And wider without shading (<HR SIZE=6 NOSHADE>) You can also center the ruler (or position it to the left or right) and limit the width of the ruler (<HR WIDTH=200 ALIGN=CENTER SIZE=4 NOSHADE>) |
Text can be aligned in different ways to enhance readability.
|
You can center the text (<CENTER>...text...</CENTER>)
Additional paragraphs can be added (separated from the previous paragraph here by the line break tag (<BR>), which starts a new paragraph, but without a blank line. The paragraph tag <P> starts a new line here, but adds a single blank line first. The text, however, will remain centered until the closing </CENTER> tag. |
If you do nothing, text will be justified to the left, like this paragraph. By enclosing the text in <P ALIGN=RIGHT>...text...</P>, you can force the paragraph to be right aligned (next to a photograph or in a table). .Left alignment is the default. Just enter text without any special tags to get left justified text. |
|
A block of text can be indented from a preceding and following paragraph (left justified, but indented on both the right and left) by using the <BLOCKQUOTE>...text...</BLOCKQUOTE> tags.This allows you to add some information, set off from the remainder of the text. Both margins are indented, as well as having a blank line before and after the text.This will add some special emphasis or break up the text for easier reading by the viewer. |
|
Normally, one or more spaces in the source are condensed to one space by the browser. If you want to actually have more than one space, say to look like a tab, you can insert the special symbol for a
non-breaking space (where more than one will not be reduced to a single space), (you need to enter all six characters!).Thus, by including 6 of these at the start of the next paragraph, we get the following: This paragraph now appears to have been tabbed over when started. Following sentences (and paragraphs) adhere to the normal rules for spaces. |
Links (often referred to as hyperlinks) are the way you can direct a viewer to another page, to view an enlarged image, select a music piece, or to download a file from your site.
Links are of the form:
This code would result in the following: text for linkThe following definitions apply for the name field.Clicking on the underlined text would take the action described below.
The text for link can be any text you want, or a picture, or both.
Note: If you are using frames, you need to include a TARGET="frame_name" parameter. (See the Frames portion of this tutorial for details.)
An e-mail link on your page is similar to other links above, except it opens a browser e-mail window for you when clicked.
The e-mail link is of the form:
<A HREF="mailto:e-mail_address">text for e-mail</A>
Again, you can use an image and/or text for the active link.
If your Web site changes locations, you can automatically direct users from the old URL to the new one. Doing so is very easy. Just above the </HEAD> tag, add the following line:
<META HTTP-EQUIV="refresh" CONTENT="10; URL=http://www.newurl.com" >
where 10 is the number of seconds and http://www.newurl.com is the page to jump to. You should also include a regular hyperlink (see above) on the same page for
those users who don't want to wait 10 seconds or have browsers that don't support the tag.
Comments or suggestions: ![]() | ![]() |
If you need some help creating your own web pages, send me e-mail.
Copyright © 2004, Jim Hanson
This Page is the product of Ray Bradbury's Homesite 2.5.
Last updated Nov. 2004