In this chapter you will learn to create HTML pages with a standard text editor.
OBJECTIVES
Upon completing this section, you should be able to
- Choose a Text Editor.
- Create a Basic Starting Document.
- Understand and Set Document Properties.
- View Your Results in a Browser.
| Choosing a Text EditorThere are many different programs that you can use to create web documents. Text editors are basic word processing programs without all of the "bells and whistles" of full-blown word processors. The advantage of using a text editor is that the files are created and saved with few if any invisible formatting codes, which could drastically effect your document when, saved as a web page and displayed in a browser. For this reason, text editors can be used quite effectively to create web documents. HTML Editors enable users to create documents quickly and easily by pushing a few buttons. Instead of entering all of the HTML codes by hand, these programs will generate the HTML ‘source code’ for you. HTML Editors are excellent tools for experienced web developers; however, it is important that you learn and understand the HTML language so that you can edit code and fix ‘bugs’ in your pages. The current versions of both Microsoft Word and Corel WordPerfect also have the abilities to create web pages. For this course, we will focus on using the standard Microsoft Windows text editor, NotePad. You can apply the same concepts using any text editor on any platform. |
Starting NotePadNotePad is the standard text editor that comes with both 16 and 32-bit versions of the Microsoft Windows operating system. To start NotePad in Windows 95 follow the steps below:
|
| Creating a Basic Starting Document As stated in Chapter One, there are certain elements that are required in a web document’s structure. The easiest way to create and develop a document is to type the required elements in as a starting point. This way you can add to your document by inserting elements and adding content between the starting and ending tags of existing elements and you won’t have to try to remember if you have typed in the closing tag or not. In NotePad you would start with: <HTML><HEAD><TITLE></TITLE></HEAD><BODY> </BODY></HTML> At this point your page has a HEAD and a BODY section inside the HTML tags. You also have a TITLE element, inside the HEAD element, which you should fill in. The text in the TITLE element is used by the surfer’s browser and also by search engines. The TITLE of your document appears in the very top line of the user’s browser. If the user chooses to "Bookmark" your page or save as a "Favorite"; it is the TITLE that is added to the list. The text in your TITLE should be as descriptive as possible because this is what many search engines, on the Internet, use for indexing your site. The following is an example of a document title: <HTML><HEAD><TITLE>TrainingTools.com: HTML, JavaScript, FrontPage Courses for Free</TITLE></HEAD><BODY> </BODY></HTML> |
| Setting Document Properties Document properties are controlled by attributes of the BODY element. For example, there are color settings for the background color of the page, the document’s text and different states of links. |
| Color Codes Colors are set using "RGB" color codes, which are, represented as hexadecimal values. Each 2-digit section of the code represents the amount, in sequence, of red, green or blue that forms the color. For example, an RGB value with 00 as the first two digits has no red in the color. See the chart below for a listing of some of the commonly used colors:
There are several resources available on the Internet that chart colors and their hexadecimal values. If you require more information about color values, there is an excellent site entitled "VGDesign’s Interactive Color Cube" that displays the background color code when you put your cursor over a small color sample. The web address is:http://www.vgdesign.com/color.html |
| The BODY Element The BODY Element of a web page is an important element in regards to the page’s appearance. This element contains information about the page’s background color, the background image, as well as the text and link colors. If the BODY Element is left blank, web browsers will revert to their default colors. In older browsers, if the BODY element is left blank, the page’s background color will be a light gray. The newer browsers, IE 4+ and Netscape 4+, default to using the client’s Windows colors settings. It is very common to see web pages with their background color set to white or some other color. To set your document’s background color, you need to edit the <BODY> element by adding the BGCOLOR attribute. The following example would display a document with a white background color: <BODY BGCOLOR="#FFFFFF"></BODY> |
| TEXT Color The TEXT attribute is used to control the color of all the normal text in the document. This will affect all of the text within the document that is not being colored by some other element, such as a link. The default color for text is black. The TEXT attribute would be added as follows: <BODY BGCOLOR="#FFFFFF" TEXT="#FF0000"></BODY> In this example, the document’s page color is white and the text would be red. As suggested earlier, it is important to ensure that your document’s text is a color that will stand out from your background color. |
| LINK, VLINK, and ALINK These attributes control the colors of the different link states:
<BODY BGCOLOR="#FFFFFF" TEXT="#FF0000" LINK="#0000FF" VLINK="#FF00FF" ALINK="FFFF00"> The results of the above BODY element would be a white background with links being blue, visited links as magenta and active links colored in yellow. |
| Using Image Backgrounds The BODY element also gives you the ability of setting an image as the document’s background. Background images are "tiled" in the web browser; which means that they are replicated and positioned below and beside each other until the browser screen is filled. To create a professional look, images must be ‘seamless’. Meaning that when the copies are placed below and beside each other the seams are invisible. Using background images can be very effective if used properly. For instance, you may want your company’s logo as your background or you could also create a border background so that it appears as though your page is divided into two columns. A background image must be either in the form of a .gif or .jpg file. There will be more information on image files provided in Chapter 6. An example of a background image’s HTML code is as follows: <BODY BACKGROUND="logo.gif" BGCOLOR="#FFFFFF"> In this example, we have set the document’s background image to ‘logo.gif’. We have also added the BGCOLOR attribute as well so that the browser window will have a white background during the process of loading the background image.
| |||||||||||||
0 comments:
Post a Comment