The next few sections will help you create your own web page. Open Notepad and follow the instructions given for using each tag.
Every HTML file must begin with <HTML> and end with </HTML>.
These two special tags tell your browser that the file is written in HTML and that it should translate every tag it finds between them into the proper effect. Everything you put in your HTML file must go between these two tags so you'll probably want to leave a lot of space to work with.
There are two separate parts to an HTML file - the HEAD and the BODY. The HEAD comes first, is surrounded by the <HEAD> and </HEAD> tags, and usually contains information about the HTML file that is not displayed as normal text. Often, it will include the author's name, keywords, and a summary of the file, though these things are never actually displayed in the browser. Instead, they are used by search engines and other programs to categorize or list the page. Since none of this information is displayed, you do not need to include it.
One exception to this invisibility rule, however, is the title of your page. If you look in the Titlebar of your Netscape window, you should see the title of the page you are on. If you were to find the page in a search engine or among your Netscape bookmarks, it would have the same title. You can use the <TITLE> and </TITLE> tags (within the HEAD section) to indicate what the title of your web page should be.
Finally, it is time to create the BODY section of your file. Everything you place in this section will be displayed in the main window of your browser.
Unlike the other tags you've seen so far, the BODY tag has a few options, called attributes. These are special instructions which you can include inside the tag to customize your page. Each attribute is written as name = value where name is the name of the attribute and value is what you set it to be. You are never obligated to include these attribute pairs; they are completely optional.
For example, typing in <BODY BGCOLOR="blue"> instead of just <BODY> will make the background color of your page blue. (Note that there is a space between BODY and BGCOLOR)
The most popular attributes of the BODY tag are:
Name | Value | Effect |
---|---|---|
TEXT | a color | changes the color of all normal text |
BGCOLOR | a color | changes the background color |
BACKGROUND | a filename | displays an image file as the background |
Thus, if you wanted a black page with white text, you would use: <BODY BGCOLOR="black" TEXT="white"> If, on the other hand, you had a picture of cats named "cat.gif", you might try: <BODY BACKGROUND="cat.gif" TEXT="red"> That would tile the cat picture over and over as the background of your page, and all your text would appear in red!
Here's a list of the available colors:
Available Colors | ||||
---|---|---|---|---|
YELLOW | GREEN | BLUE | RED | WHITE |
GOLD | AQUAMARINE | MIDNIGHT BLUE | PINK | SILVER |
ORANGE | TURQUOISE | PURPLE | LAVENDER | GRAY |
BROWN | SKY BLUE | MAROON | BEIGE | BLACK |
Here is what you should have so far. Don't worry if the spacing is a little bit different, or if you've chosen different colors. Just make sure you understand what each tag does. If you're confused, ask a TA for assistance.
(If you would like, you can copy all of this by highlighting it and choosing "Edit|Copy". Then you can paste it into your HTML file in Notepad instead of typing in each of the codes yourself.)
<HTML> <HEAD> <TITLE> Title of the Web Page Goes Here </TITLE> </HEAD> <BODY BGCOLOR="white" TEXT="black"> (All the content of your web page - what you want your viewers to see in their main window - will go here. This section is usually be quite long.
</BODY>
|
PREVIOUS | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | NEXT |